Using a pressflow fork of Drupal 6 and the menu module, I get this fatal error with the tracelytics module: PHP Fatal error: Call to undefined function menu_get_item() in sites/all/modules/contrib/tracelytics/tracelytics.module on line 148

menu is weighted 0 and tracelytics is weighted at -10001 ... should the weights be altered?

Comments

pdrake’s picture

Status: Active » Postponed (maintainer needs more info)

The module weight should not be a problem as menu_get_item() is defined in includes/menu.inc. Can you point me to the exact fork/version you are using of D6 and provide a backtrace so I can get a better idea of why this is happening?

Spechal’s picture

Unfortunately it isn't just a Pressflow D6, it is the Tag1 Pressflow D6 v6.26 fork.

https://github.com/tag1consulting/pressflow6

I will work towards getting the backtrace.

pdrake’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

tag1consulting does not have a v6.26 branch as far as I can tell, at least not in that repo. Pressflow has a 6.26 tag (pressflow-6.26.109) and I have tested it with both 6.x-1.2 and 6.x-1.x and was unable to reproduce the fatal error. I have added a check in 6.x-1.x to ensure that tracing of menu items cannot be enabled if menu_get_item does not exist.

bobmurdoch’s picture

I have also encountered this issue, with Pressflow 6.26. ( Not tag1consulting here, standard Pressflow. ) It may also be worth noting when I uncheck the menu hook checkbox in the module configuration, the next error encountered is
Fatal error: Call to undefined function drupal_alter() in /.../sites/all/modules/tracelytics/tracelytics.module on line 188

pdrake’s picture

Status: Closed (cannot reproduce) » Postponed (maintainer needs more info)

@bobmurdoch thanks for reporting this followup. Were you using drush or was that on a regular page load (ie index.php)?

bobmurdoch’s picture

Regular page load.

pdrake’s picture

@bobmurdoch, can you give me a method to reproduce and/or provide a backtrace when this problem occurs?

beifler’s picture

Hi pdrake,

I'm using the Tag1 Pressflow branch and I'm getting the php fatal error described here. The Tag1 branch is at 6.26. See: https://github.com/tag1consulting/pressflow6

I'll PM you as well.

pdrake’s picture

@beifler, a backtrace would be great, if you can provide one.

Eronarn’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.25 KB

I've updated this ticket to major because it's a crash bug that can be triggered in multiple ways... but I've also updated it to needs review because I've attached a patch! :)

The problem here is that under certain circumstances - redirects like Secure Pages, full-page caching, and possibly more - the Drupal boostrap process can call hook_exit before certain includes are called. Calling the included functions in this context results in a crash.

Unfortunately, there appears to be no variable to check current Drupal bootstrap phase. The best approach that I've found is to check whether the necessary functions exist. The attached patch does so - it applies cleanly to both the D6 and D7 versions of the module with `git am` (though I haven't tested whether the same line is needed in both places for the D7 version to prevent crashes).

pdrake’s picture

In D7, bootstrap_get_bootstrap_phase() may be an option, however, the implementation in your patch may perform better.

pdrake’s picture

Status: Needs review » Fixed

I have committed a slightly modified version of the patch in #10. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.