When I try to use this module by inserting [[Title]] brackets into the body of a node I get WSOD.
PHP error log reads:
PHP Fatal error: Cannot redeclare freelinking_drupalorgnid_callback() (previously declared in ../sites/all/modules/freelinking/plugins/freelinking_dev.inc:19) in ../sites/all/modules/freelinking/plugins/freelinking_dev.inc on line 43
I can fix the problem by commenting out:
$freelinking = freelinking_get_plugins();
in the freelinking.module in the freelinking_filter function around line 48
Running on Drupal 6.16 with a MAMP stack
Will test other functionality and report back if any other issues arise as a result, but okay so far!
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 800414_wsod.patch | 722 bytes | burningdog |
| #3 | freelinking_freelinking-require_once.patch | 542 bytes | davideads |
| #2 | freelinking_freelinking-require_once.patch | 635 bytes | davideads |
Comments
Comment #1
davideads commentedI get the same error (with the path plugin), but looking at the module's own implementation of its 'freelinking' hook, I suspect something is very, very wrong...
Comment #2
davideads commentedThere error seems to be the use of the
requirevs.require_oncein the event thatfreelinking_freelinkingis called more than once.Attached is a very simple patch, which resolves this behavior.
Comment #3
davideads commentedWhoops, there were some extraneous lines the diff from a .swp file. Here's a new version of the same patch.
Comment #4
jaclayton commentedApplying the patch allows the site to continue loading but anywhere I put a [[NodeTitle]] link there's now "Plugin nodetitle Not Found" and 3 shiny error messages at the top of the screen:
warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\test\sites\all\modules\freelinking\freelinking.module on line 115.
warning: Missing argument 2 for l() in C:\xampp\htdocs\test\includes\common.inc on line 1585.
warning: Missing argument 2 for l() in C:\xampp\htdocs\test\includes\common.inc on line 1585.
Comment #5
Grayside commentedYes, also discussed #807004: Add Instructions to Delete Previous Freelinking Alpha on Installation.
These bugs and some architectural issues in future implementation of support for node access needs some heavy reworking. That is in progress, in the course of work this should go away.
@davideads: Thank you very, very much for the patch. The depth of issues right now means the next Alpha will be a lot of new code, so the 3.x-dev is going to be unchanging for a couple more weeks as I get a new "slate" to work off of in place.
Comment #6
pje commentedThe real issue here is that freelinking_freelinking() gets called multiple times, for reasons I didn't bother figuring out. require_once doesn't fix the other error messages, because then $freelinking is an empty variable and that causes the foreach() errors. The simplest fix is to make $freelinking static and exit early if it's already set:
(The other change shown removes an extraneous '/' from the included filenames.)
(FWIW, I do not have any leftover files from a previous version, at least AFAICT.)
Comment #7
Grayside commentedThat's for the looksee PJE. I'm doing a major refactor on FL for the next Alpha, so this code will get a good re-examination.
Comment #8
discipolo commentedcan confirm that the changes in #6 apparently achieve the desired outcome. (no more wsod)
thanks
Comment #9
Suitov commentedThank you, @pje #6! This fix worked a treat for me.
Comment #10
smokrisThe patch on #6 solves the problem for me, too. Grayside, can you commit this patch?
Comment #11
sepla commentedThe patch at #6 works fine, thanks pje.
Comment #12
burningdog commentedAny movement on this? I've re-rolled the patch at #6 using git diff and made 'require' into 'require_once'.
Comment #13
Grayside commentedSo I finally made it back here. Very sorry about that. I just pushed a fix to the dev branch which should appear in the next nightly roll.
I adjusted the approach and the syntax of the patch for style and personal preference and resolved #4 which properly should have been a separate bug.
If the fix works I will tag a new alpha.
http://drupalcode.org/project/freelinking.git/commit/d1f88bb