Apparently there is a missing function: node_access_needs_rebuild()

The error only shows in my error_log file, not within Drupal's log messages.

EX:

[18-Oct-2011 16:28:43] PHP Fatal error: Call to undefined function node_access_needs_rebuild() in
/home/cviningc/domains_html/drupal-7.8/sites/all/modules/taxonomy_access/taxonomy_access.module on line 598

These seem to have only appeared when I updated to the rc1 release, but they persist in the latest -dev also.

Thanks!

-- Cronin

CommentFileSizeAuthor
#5 1313912-5.patch619 bytesxjm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cvining’s picture

Hmmm. I see node_access_needs_rebuild is part of node.module (core). Doh. Still, I've no idea yet why I'm getting this error yet. I'll post back if I sort it out.

-- Cronin

xjm’s picture

Status: Active » Postponed (maintainer needs more info)

Yeah, that's a really weird error... Like, the node module would have to not be loaded for that to happen.

cvining’s picture

OK, I think this is a real bug. I tried all sorts of things to narrow down the source, and I think this will reproduce the bug. It seems to require both anonymous caching and the TAC module.

1. Fresh install of D-7.8 (I used the "minimal" install profile for this test)
2. Go to admin/config/development/performance
3. Enable "Cache pages for anonymous users"
4. Enable Taxonomy Access Control module
5. Pull up your site's homepage URL in another browser (i.e., not logged into your site)
6. The page seems to load fine
7. There are no errors or warnings in dblog
8. But the PHP error file (error_log) has entries like:

[20-Oct-2011 14:27:46] PHP Fatal error: Call to undefined function node_access_needs_rebuild() in /home/xxxxx/public_html/drupal-7.8/sites/all/modules/taxonomy_access/taxonomy_access.module on line 598

9. The Apache access logs also indicate error code 500 (along with plenty of otherwise successful requests)

Now, I didn't seem to see this problem in the prior release. So, with the same minimal install I did the following to install the prior alpha version:

rm -r taxonomy_access
wget http://ftp.drupal.org/files/projects/taxonomy_access-7.x-1.0-alpha1.tar.gz
tar taxonomy_access-7.x-1.0-alpha1.tar.gz

And sure enough, the error 500s and Call to undefined functions go away.

reinstall the rc version, bugs come back.

I haven't tracked down the differences between the alpha and rc1 that might account for this. If I get a moment, I'll look for for that too.

-- Cronin

xjm’s picture

Status: Postponed (maintainer needs more info) » Active

Oh, I think I know what's going on here. It's part of a registered shutdown function. Awhile back I moved the registration from hook_init() to hook_boot() because of another issue someone had--#1273080: [Rollback] Move registration of shutdown function from hook_init() into hook_boot()--but I guess the check for node_access_needs_rebuild() isn't available in cached mode then (which also makes sense).

Hmm. I need to do some research on this.

xjm’s picture

Status: Active » Needs review
FileSize
619 bytes

Try this patch, perhaps.

xjm’s picture

Though, this really calls into question how or why the user I was helping on IRC had the problem that led to the patch in #1273080: [Rollback] Move registration of shutdown function from hook_init() into hook_boot(). If the node access system isn't even available, we're not going to be able to update node access... and why would the user need to update node access from a cached page?

cvining’s picture

Excellent! Works for me, on both my minimal test site and my live site.

It's still curious that the prior alpha version didn't have this issue. But hey, fixed is fixed.

I hate it when my error_log file starts filling up. Makes me bloated. Much relieved now. Thanks!

-- Cronin

roderik’s picture

@6: hmmm.... good question. (Unfortunately I have no clue.)

Well I guess I'll do 'patch -R < hook_boot.patch' to solve this issue for me, for now...

hcderaad’s picture

I can confirm applying this patch on a Drupal 7.10 with Taxonomy Access 7.x-1.0-rc1 makes the error message disappear, thanks for your solution!

xjm’s picture

Title: undefined function node_access_needs_rebuild() » undefined function node_access_needs_rebuild() on cached anonymous requests
xjm’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

rickmanelius’s picture

Any chance we get another release (RC2?). I was just bit by this and would love to see it released in all other sites I have with this module! :)

xjm’s picture

@rickmanelius -- rc2 will be coming soon (I hope), with some major UX improvements. I've just gotten sort of sidetracked from TAC this past month.

I may release an alpha with the UI changes sometime in the coming week, so if you're able to help test that, it'd be awesome!

Putr’s picture

Patch works on a live site with Drupal 7.12 and Taxonomy Access 7.x-1.0-rc1

Tgr’s picture

This bug can appear on non-anonymous requests as well. I'm getting it when a user with a fairly high level of access control (bypass content access control, administer content etc.) but no adminstator privilege tries to edit or translate a TAC-enabled node. (I use Drupal 7.14, TAC 7.x-1.0-rc1, page caching is enabled.)

The error is a proper white screen of death, not just a log message. The reason for that is possibly that I use FastCGI, which handles register_shutdown_function() slightly differently.

Putr’s picture

Status: Closed (fixed) » Reviewed & tested by the community

Ok so my #15 comment confirming the patch was posted 7 months (!!!) ago.

Yesterday, on a totaly different project with version 7.x-1.0-rc1, this error brought a live site down. Imagine my suprise when i find this bug report and see my comment.

I'm not going to change the Priority ... but a php fatal error is kind of a big deail.

Snakehead’s picture

Title: undefined function node_access_needs_rebuild() on cached anonymous requests » undefined function node_access_needs_rebuild() on cached anonymous requests [DID I SOLVED IT EASILY?]

Hi all
I've had the same issue and tried to follow your instructions (Thanks for it).
I am not sure whether I did solve the problem but I disabled under /admin/config/development/performance the aggregation of Javascript & CSS, cleared all caches and enabled the aggregation again. And then the fatal error messages disappeared. But I am not sure whether theses messages will appeaer again.
Also I realized that these messages appeared only in simple pages content types (easily modified with decoration images for each page and with no taxonomy access fields). And not on all other simple pages. Really strange.
Hope this helps for some of us.
Kind regards, Hans

xjm’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Again, this was fixed in the dev branch.

Putr’s picture

@xjm
While i am very thankfull for the work you do...

It's not fixed untill it's published, and dev branch is not something you should considere production ready and as such, fixes only in the dev branch should not be considered published... or production ready.

But if the dev branch is production ready please relise another RC.

Also I should point out that RC1 is still the recommended relise, which means people are still installing a module with an incorrect function name.

slashrsm’s picture

@Putr You can always volunteer to co-maintain ....

mikolaskova’s picture

Hello,

I get the same error. What is the recomended solution to this?
to install the dev-Version or the patch above?

Regards

Adriana

farrington’s picture

It's up to you, but if you don't experience any other issues... go with the patch.

If you use the patch, that will not break break when you update to the next recommended version (since it's already in the DEV). DEV could contain something else that is not ready for production, but this patch is.

Hope that helped you to decide (or someone else if you already have decided).

themic8’s picture

I also had this same issue. Applying the patch solved my problem.

RAWDESK’s picture

Issue summary: View changes

patch worked indeed also for me

MrPaulDriver’s picture

Patching for now, but a, RC2 release would be most welcome

rcodina’s picture

Patch on #5 works for me too. Hope to see a RC2 release soon!

fonant’s picture

The dev version worked here to fix these errors. A new official release would be handy.

domesticat’s picture

Chiming in; the Support team has seen several instances of this issue as well.

+1 to new RC release.

fizk’s picture

Title: undefined function node_access_needs_rebuild() on cached anonymous requests [DID I SOLVED IT EASILY?] » undefined function node_access_needs_rebuild() on cached anonymous requests

Just ran into this as well. I'll try to publish a much needed release.

fizk’s picture

7.x-1.0 has been released: https://www.drupal.org/node/2571205