WBCE CMS – Way Better Content Editing.

You are not logged in.

#1 08.04.2018 19:57:39


OneForAll Error under certain circumstances

Hello Christoph (freesbee),

i am playing with the OneForAll module the first time and find it quite impressive. I think that's pretty useful and brings new possibilities for the CMS – great work!

But I encountered an error with item detail pages:
When I am trying to access a detail page, i get this error:

require(../../../config.php): failed to open stream: No such file or directory

And yes, in my usecase the OneForAll module is used on second level page, so the config.php could be found at ../../config.php, not at ../../../config.php. There is a ../ to much.

I already found out, that this relative path – written into the php access file – is created in in save_item.php and also in upgrade.php (for upgrading existing installations with older versions of OFA module, i assume), so i could fix this wrong behavior in my case. But I wondered why there is no early report of this issue, as it should affect all current OFA versions which utilizes detail pages. Does this error only arise on my system? I am on a Mac with latest OS and using MAMP PRO as local development server, with PHP 71.12 at the moment ... but i cannot imagine, how this should affect the file path calculation.

Could you have a look on that?

Some further info: I am using version 1.0.8 of the Module, downloaded her: https://addons.wbce.org/pages/addons.php?do=item&item=9 and changed the module name in the info.php to "joboffers". Again, i don't think this has an effect on the path calculation, but who knows ...

By the way: What are these other downloads for, provided in the WBCE addon repo on the URL mentioned above (allitems, anyitems, itemgroup and topitems)?

EDIT: As i was writing this post, i probably found the solution:
I initially removed the /pages directory by emptying the corresponding input field in the general settings of WBCE in order to get shorter URLs – like i almost always do. So my pagetrail is indeed on step shorter than with default settings. But i think, get rid of the /pages directory is a common practice and the WBCE-own function for calculation then relative include path for the index.php does not struggle with this none-pages-directory-setting. So maybe its worth to implement this type of settings into the OFA. Or maybe there is an existing workaround i am not aware of?



#2 08.04.2018 22:36:57


Re: OneForAll Error under certain circumstances

Thank you for your error report.
Unfortunately Christoph has stopped maintaining his modules some months ago.

Beside of this, removing the /pages directory is never a good idea and this practice is hopefully and probably not as common as you asume.
It's just not expected from the system and might have other unwanted side effects. You can do this, but you should not, as well as you can remove the doors from a car and you can still drive with it, but will encounter problems sooner or later.
If you really want to get rid of the /pages directory you can either rename it or use the shortURL module to get URLs like domain.tld/url-to-my-page/

Information about the snippets as described in their info.php files:

This snippet displays the linked title of all OneForAll items on any page you want.

Snippet to display a specified number of items of a given OneForAll module section.

This snippet displays the linked item titles of a specified OneForAll group on any page you want.

Snippet to display the top positioned items of all OneForAll sections.


Board footer