HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[SOLVED] Requests to Filedump causing Critical Bailout

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#102639 (In Topic #20113)
Avatar

Well-settled

Required php hook file is missing

Greetings!

I've just set up a catalogue whose entries request viewing of files uploaded to the Filedump. Unfortunately, clicking the link of any entry triggers the following critical error:

Critical error – bailing out This is an error that has been elevated to critical error status because it occurred during the primary error mechanism reporting system itself (possibly due to it occuring within the standard output framework). It may be masking a secondary error that occurred before this, but was never output - if so, it is likely strongly related to this one, thus fixing this will fix the other. A source code file is missing: hooks/systems/content_meta_aware/filedump_file(/home/…/…/ocportal/sources/
hooks/systems/content_meta_aware/filedump_file.php or an overridden equivalent to this path) (version: 9.0.9, PHP version: 5.3.27, URL: /ocportal/site/pg/catalogues/entry/core-articles-and/miscellaneous-articles/adamethode)
 

A full search of my installed ocP v9.0.9 source files confirms that the required hook file is indeed missing from my installation (the closest-matching file-name found is sources/hooks/systems/ajax_tree/choose_filedump_file.php)
Since I've not previously had occasion to request any of my extant Filedump uploads, it's impossible to say whether the missing hook was originally installed or has somehow been deleted subsequently. 

If any of you were able to come to my rescue I'd be enormously grateful! (In view of what I've ascertained, I haven't included the full stack trace for the reported error here, but of course shall do if it might be of assistance.)

Thanks for reading!

(btw, the catalogue works fine if set to request files from other system-managed storage folders!)


Last edit: by RichT
Back to the top
 
Posted
Rating:
#102641
Avatar

Ah, sorry that option should never have been presented. There is no content framework support for filedump files as they are too informal. You probably want to use Downloads instead.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#102646
Avatar

Well-settled

Greetings, Chris, and thanks!

Obviously what you've said caused me some surprise! So, would I be right in inferring that filedump_file.php has been intentionally excluded from installation packages since some ocP version's release?

Your most helpful comeback also makes me question my initial assumptions about what the File/Media Library can be used for. Apart from its usefulness for file-sharing, is it provided (and programmed) specifically as an adjunct to the Downloads system, or (given that user-created catalogues can't) are certain other modules able to request items uploaded to it? Where does the (still included) ajax-tree hook figure in all this?

Another filedump related question that puzzles me (though forgive me if you feel it's slightly off-topic) is the purpose of File/Media Library folders - other than for purely organizational convenience. It seems strange that they're not subject to the Permissions system when just about everything else that shows up on the Site Tree Editor is. In addition, although folders generate page-links that include their name ("place=") when items are viewed from within them (filedump:misc:place), it's similarly strange  that _WILD: type match-key page-restrictions on specific usergroups, based on these page-links (e.g. supermembers or supermoderators) don't have any effect on their accessible-to-all status (at any rate, in my experience!)

Please, might you be willing to comment on any of these points when you've the chance?

Thanks again and kind regards,

Richard
Back to the top
 
Posted
Rating:
#102647
Avatar

There's just an incorrect assumption in the fields system that anything defined in ocPortal with a selection widget must also have all the content management stuff defined for it. This is correct for everything except the filedump (File/Media library), which is not a place for formally managed content management, just a free-form place to put files for referencing by URL. It's a simple file manager (*). It has no permissions etc, and never was designed to have them – that's what the download system is designed for.

This is the kind of bug that happens when we code abstractly and make some mistake about our assumptions of how such abstract things fit together. In this case, the filedump has a selection widget because it is needed when adding attachments by picking out files from within it, or when doing searches under it.

(*) In the spirit of leaking stuff for v10, it will be much more sophisticated in v10, but still in the same vein – a free-form system, not a formal mechanism for managing content.

filedump:misc:place

This means:
zone=filedump
page=misc
type=place

Which is wrong.

Let's say it was corrected to cms:filedump:misc:place…

That would mean:
zone=cms
page=filedump
type=misc
id=place

Which would still be wrong: there's no 'id' involved here.

Correcting again…

cms:filedump:misc:place=something

That is now valid, for targeting a specific value of 'place'.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#102653
Avatar

Well-settled

Many thanks for your explanation, Chris - anything you have to say about the File/Media Library really helps, as there's so very little in the tutorials (3 sentences and an image, in fact)

As for the match-key matter, the formulation I put in my post was really meant as a generalized abstraction, and only of the latter part of the argument, and I do apologize for it possibly having misled you. In fact, the actual, fully formed match-key argument I  applied  - on the basis of the returned pathway - seems to be exactly as per your explanation, i.e. _WILD:cms:filedump:misc:place=staff_use_only, yet in practice it fails to deliver, and it's that specifically that's the cause of my puzzlement.

Frankly, though, this matter is basically one of academic interest than practical need, and so I  think really isn't worth the bother of investigating. In reality, staff with direct server-access of course don't need the filedump at all for storing core-content files when it's even easier to create system-independent folders for that purpose via cPanel and have ocP upload them or request them from there. Which is what I've been doing for the past month or so. The Library is best left as originally intended, an area specifically for file-sharing by collaborating Super-members, rather than extended to permit file-cloistering by staff, and what matters is that it's fully functional for them.

I can hear you sighing...

Best regards,

Richard
Back to the top
 
Posted
Rating:
#102656
Avatar

_WILD:cms:filedump:misc:place=staff_use_only

"_WILD:" should not be there as "cms" is the zone, and nothing goes before the zone.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#102661
Avatar

Well-settled

Thanks for that, Chris! I think at last it's put me straight about the function of _WILD and its relationship to values following it: it's simply a wildcard parameter that could be used in place of any specifically declared value in the key, apart from its last value. If I've got it right, then, our example, if declared as _WILD:_WILD:_WILD:place=staff_use_only would produce the equivalent folder restriction. Am I correct?

You're probably wondering why I don't just answer that for myself by trying the argument out. Fact is, unfortunately our now corrected, value-declared example, even now, isn't having any effect and therefore I'd predict that the wildcarded version would also fail to - so I'd be none the wiser about its validity. 

I've a hunch the reason for our example's failure just might be related to the value for place and the required syntax for declaring it. The path that my Chrome browser is returning reads 
cms/pg/filedump/index.php?place=%3Aslash%3Astaff_use_only%3Aslash%3A
- does that indicate anything of the sort to you?

If that isn't accountable for the failure, presumably what is would be a matter requiring investigation. As I've said, I don't think that would be worth the bother, given my perfectly satisfactory alternative to using the filedump, and I really wouldn't wish you to spend time on this on my behalf. v.10's changes, in any case, may well obviate the causes, and I'm more than happy to wait for its release before reconsidering my current strategem. But I really would appreciate your comeback on my first paragraph above!

Kind regards,

Richard
Back to the top
 
Posted
Rating:
#102662
Avatar

Am I correct?

Almost. I don't think it works for anything other than the zone or page though.

does that indicate anything of the sort to you?

Try cms:filedump:misc:place=/staff_use_only/


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#102666
Avatar

Well-settled

Eureka!
107 views (50 Kb)

My hunch was correct then! I'd actually tried a few keys with slashes but was thrown by the %3A colons, and I'd have given up for good without your interpretative savvy. 

Thanks so much for steering me through this, Chris - cracking it doesn't just cure an itch that would've continued nagging, but more importantly demonstrates the possibility for Supermembers collaborating on a project to file-share privately and separately with respect to other concurrent projects (by creating a unique Usergroup for each team). And of course, there would still be provision for communal sharing as is.

Best of all is what I've learnt from the exercise, thanks to your ever-well-timed hints and explanations! I'll tag this as [solved] now.

Best regards,

Richard
Back to the top
 
Posted
Rating:
#102669
Avatar

Yeah "%3Aslash%3A", means "/", through a couple of layers of coding scheme.

"%3Aslash%3A" –> ":slash:" –> "/".

First URL encoding, then a weird workaround we have to do to a design flaw in mod_rewrite on Apache.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: