I'm getting a "Fatal error: Call to undefined function xxxxxx() in /sites/all/themes/mytheme/template.php" when I try to import an .ris file. First the function was biblio_openurl(), so I commented out that line, then it was _biblio_keyword_links(), so I commented that out, then it was _build_biblio_link(), so I gave up on that tack :)
I am using theme overrides in template.php of theme_biblio_long() and theme_biblio_export_links() in my template.php file, and - strangely enough - I don't get the fatal errors when viewing a biblio node (and the openURL and Keyword links display just fine when they're not commented out).
I'm not sure why the theming functions are even being called on import. I assume both import mechanisms are the same, but FWIW this happens both at admin/settings/biblio/import and at biblio/import/form.
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#2 | import.ris_.txt | 9.9 KB | John Bickar |
Comments
Comment #1
rjerome CreditAttribution: rjerome commentedI don't know why this would be happening, the import code doesn't call any theme functions.
Are you using "batch" import or direct?
BTW, "admin/settings/biblio/import and biblio/import/form" are one in the same, just a different route to get there.
Comment #2
John Bickar CreditAttribution: John Bickar commentedThis was with the direct method. The type of error message I get is a general PHP fatal error message (white screen).
When I try batch, it also fails, but I get "An error has occurred. Please continue to the error page." And Drupal has set an error message of:
An error occurred. /batch?id=23&op=do <br /> <b>Fatal error</b>: Call to undefined function biblio_openurl() in <b>sites/all/themes/mytheme/template.php</b> on line <b>281</b><br />
I wonder if there's a problem with the import file? It's attached. I'll try breaking it up and seeing if I can isolate the problem.
Thanks!
Comment #3
rjerome CreditAttribution: rjerome commentedI imported it without issue, so I don't think it's the file.
Comment #4
John Bickar CreditAttribution: John Bickar commentedHm. I took out the first record in the .ris file and it imported OK. When I try to import just that record as an .ris file, it chokes with the same error. There doesn't seem to be anything unusual about that record, nor does it explain why I get that particular error message. Let's hope it doesn't show up again.
Comment #5
John Bickar CreditAttribution: John Bickar commentedWhen it gives the fatal error on import, it does import the record, with the author of the Drupal node set to Anonymous.
When I go to edit that node, give it a taxonomy term and change the author (of the Drupal node) to my user, it fails with the same "fatal error: call to undefined function".
I have a workaround for now so no need to keep this issue active, but I'll post back if I run into this again or come up with more info.
Thanks!
Comment #6
rjerome CreditAttribution: rjerome commentedThe only thing I can think of is that maybe that file contained some none visible characters at the beginning. Can't imagine how the "node author" got set to Anonymous. Are you selecting a "User ID" from the drop down list on the import form or are you just letting it default to your own name?
Did you try downloading the file from above in this post and importing it?
Comment #7
John Bickar CreditAttribution: John Bickar commentedSame error when using the file attached to this post.
And yes, I'm just letting the author default to my user.
Comment #8
John Bickar CreditAttribution: John Bickar commentedStrange, I just got the "call to undefined function biblio_openurl()" again when editing a biblio node. I have been noticing that when I edit an author's name on a record that has been imported, the edit does not "stick". My first thought was that this was a glitch in the AJAX interface, but this happens with JS on or off.
So I tried to delete both authors and that was when I got the fatal error (upon saving).
Comment #9
John Bickar CreditAttribution: John Bickar commentedSome more data points:
I haven't looked closely at the code to see how much it shares with the D5 version, but I'm wondering if it has anything to do with the "Cannot create publications without authors" bug from biblio 5.x.
Still a stumper as to why it's choking on biblio_openurl(), but I'll try to do some more testing on Monday and see if I can narrow it down a little more.
Thanks!
Comment #10
rjerome CreditAttribution: rjerome commentedDid you enter a "OpenURL Base URL" in the OpenURL section of the admin/settings/biblio page? If so, that's why biblio_openurl() is getting called. Did the undefined function call error happen on "Preview" during editing?
Comment #11
John Bickar CreditAttribution: John Bickar commentedYes; this setting carried over from my 5.x setup.
No, I didn't preview the node; it happened when I clicked "Save".
Comment #12
John Bickar CreditAttribution: John Bickar commentedNow it's strangely popping (intermittently, but reproducibly) up on faceted_search results pages. Again, no idea why it calls that function, and commenting out the call to biblio_openurl() just moves the fatal error message to biblio_keyword_links().
I know that theme_biblio_long() is deprecated, but is there currently a better way to theme the full display of biblio nodes than overriding that function? For the time being I have removed the theme function override from my template.php.
Thanks!
Comment #13
rjerome CreditAttribution: rjerome commentedYou wouldn't be running out of memory would you? Have you checked your PHP error logs?
Do you have the "Devel" module enabled? I've seen it do wicked bad things when you least expect it :-(
Comment #14
John Bickar CreditAttribution: John Bickar commentedNot on the production site, no.
I don't think so, although it's possible. I have devel enabled on a mirror dev site and it shows 40MB used on a path that works, and 30MB used on the path that throws the fatal error (server memory limit is set to 64MB).
Hadn't done that, oops. Here's what it's throwing:
Invalid argument supplied for foreach() in /sites/all/modules/ctools/plugins/arguments/term.inc on line 50.
But it apparently is generating that on other paths as well, not just the ones that throw the biblio fatal error. That error is discussed in #467898: Invalid argument supplied for foreach() in term.inc, but appears to be unrelated to the biblio error.
Edit: Removing duplicate taxonomy terms got rid of the ctools error message; now I get no error messages when calling up a path that causes the biblio fatal error.
Comment #15
rjerome CreditAttribution: rjerome commentedHmmm, so you still get biblio fatal errors, but nothing in the logs?
Did you say you had overridden some of the theme code? Perhaps that is the issue since biblio_openurl() is in the biblio_theme.inc file and if that's not getting included then it wouldn't find it.
Comment #16
John Bickar CreditAttribution: John Bickar commentedRight, I've overridden theme_biblio_long() in my template.php file.
I know the comments say that it's deprecated, but as far as I can tell, that's the function that outputs the full node view when you have the "Original" node layout style selected.
Maybe there's a better way to theme the node display?
Comment #17
rjerome CreditAttribution: rjerome commentedWhat level of caching are you using? Try disabling all caching and see if that makes any difference.
Comment #18
John Bickar CreditAttribution: John Bickar commentedI was using normal caching with page compression, CSS compression, and JS compression enabled. I disabled all of those settings and flushed the cache and still get the fatal error.
Comment #19
rjerome CreditAttribution: rjerome commentedHmmm, I'm running out of ideas here!! I wish I could reproduce this on my systems, but I can't, so it's kind of hard to fix :-0
It still sounds suspiciously system related.
What are you running on? OS/PHP/HTTP?
Comment #20
John Bickar CreditAttribution: John Bickar commentedI know, it's a stumper! I really do appreciate your help.
Debian stable (etch, I think? but maybe lenny)
Apache 2.2.3
PHP Version 5.2.0-8+etch13
phpinfo()
I also get a WSOD with no error messages on screen or in the log with the same configuration in a local MAMP environment.ETA: Same fatal error in MAMP; I had to set display_errors to On.
Comment #21
rjerome CreditAttribution: rjerome commentedOn your MAMP platform (I presume that's your test platform) could you try NOT overriding the theme functions and see what happens?
Comment #22
John Bickar CreditAttribution: John Bickar commentedI actually took out the theme function override in the production environment last week, and it works fine with no fatal errors (that I've seen so far).
I have one dev environment in MAMP and one on our live web servers as well, as I can tweak server settings on MAMP, but can't on the web servers.
I changed the "Node Layout" (at admin/settings/biblio under "Styling") from "original" to "tabular" and the fatal error went away, so it's definitely in that theme override function, but we knew that from the beginning due to the error message.
It still doesn't make any sense to my why I would get that fatal error when doing an import or using faceted search (and not, for example, when actually viewing a biblio node).
Comment #23
rjerome CreditAttribution: rjerome commentedThat's a head scratcher for sure. Maybe if you send me the theme override code I can make it happen on my end and thus get closer to an answer.
Ron.
Comment #24
John Bickar CreditAttribution: John Bickar commentedOops, sorry, been working on other stuff and forgot to follow up on this.
Here's the code. As I said, I've removed this from the template.php for the time being, therefore I'm no longer seeing the errors.
Not a lot of stuff going on in there right now, but there is some call number hyperlinking (not included) that I'd like to reintroduce at some point and it will require using a theme override.
Comment #25
Liam MorlandThis version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.