Closed (fixed)
Project:
PageEar
Version:
5.x-2.0
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
26 Oct 2009 at 17:27 UTC
Updated:
13 Nov 2009 at 13:50 UTC
It seems related to cacheing because it doesn't happen every time
From my php log:
PHP Fatal error: Call to undefined function base_path() in C:\apache2triad\htdocs\drupal\drupal-5.1\modules\pageear\pageear.module on line 289
I assume it has to do with drupal boot strapping to different levels depending on caching or not?
This is a super cool module - and I would really like it to work.
Comments
Comment #1
manfer commentedAt first look something really strange as base_path is a drupal API function. I don't know what that undefine function error.
And yes it seems related to caching. I have been able to reproduce it. Still don't know why.
I would have to ask myself to try to know how can that happen because it seems to appear with normal caching.
Comment #2
manfer commentedA research have pointed me to the problem, in drupal5 hook_init of modules is called for cached pages and common.inc is not included.
As base_path is a function inside common.inc it is not defined.
The problem, base_path issue is easy to solve just changing base_path calls with its return value $GLOBALS['base_path'], but I'm using some other functions in hook_init that are defined in common.inc so I have to ask for the best way to solve those issues.
That's for the report. I'll try to solve it as soon as possible.
Comment #3
manfer commentedWell, I have yet to confirm but I think I got the solution.
Just I have to get totally rid of hook_init function and set all that code to hook_menu(!$may_cache).
So Just deleting the function pageear_init in pageear.module and editing pageear_menu($may_cache) as follows:
should do the trick. I think the module has to be disable and reenable so this change takes effect (configured pageears if there were any have to be reenable in pageears administration page because disabling the module disables all pageears, they are not deleted just disabled).
For those following this bug they can notice another change. I included another bug fix, a bug that was reported to 6.x version and I think was present in 5.x too. When no pageear was enabled at all sometimes a js error appears. That is solved with the code I just included in this change almost at the end of the function:
I would commit the changes as soon as possible when I have confirmed it is the best solution.
And as soon as the 6.x-2.1 version is finished (probably I could just tag it as 2.1 version by now) I can start to include new features to a 5.x-2.1 version too.
Comment #4
manfer commentedI have just finished changes to include on 5.x version all new features. I have commited all the changes and as soon as the package system packages it, it would be available in the project pages as a development snapshot for 5.x.
That 5.x-2.x-dev version has all the new features and this cache bug fixed.
It would be of great help if you could test it and provide me feedback. I tested and it seems it is working but more opinions and tests would be apreciated. If it is working fine I could make it the 5.x-2.1-RC version and set it as the recommended version for drupal 5.
I don't know exactly when is the next packaging job programmed but I suppose at most in 12 hours it would be available in project page. I will notice here when it is available.
Thanks for the report again and I hope it works now.
Comment #5
manfer commentedThe 5.x dev package is by now available in the project page.
If you could test if it works for you with that version it would be very helpful.
Thanks.
Comment #6
manfer commentedFixed on dev version.
With my tests the last 5.x version is not presenting any issues but I would wait a while before deciding to make it available as a 5.x-2.1-RC release.
If you test it please provide feedback.
Thanks.