Needs review
Project:
SWF Tools
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Aug 2009 at 16:14 UTC
Updated:
16 May 2017 at 13:26 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
vegardjo commentedHia José,
my site build with OG and Spaces, and thus PURL, was also broken after installing SWFtools: all OG / space paths were removed from the links, so what should be
/mygroup/og/users/562/facesbecame/og/users/562/facesetc.Anyways, your patch fixed this for me, thanks!
Don't know if this qualifies as a community review so I'm not changing the tag.. :)
Comment #2
smk-ka commentedSorry, but even if this patch seems like it fix things, it actually just tries to detect a prefix over and over again in a brute-force manner. This patch leads to a huge overhead since the PURL prefix detection is run on every invocation of url() or l() functions (and there can be LOTS of them on one page).
The real culprit in this case are modules that call Drupal's API functions from the global PHP namespace, which leads to code execution when the system has only halfway loaded – you can't even predict which modules files have already been included and which not, and hook_init() has not even run.
The only real solution to this problem is to banish modules that are calling Drupal API functions from the global namespace (yes, not even drupal_get_path() – use dirname(__FILE__) instead), since that's a no-go. SWFTools just needs to move the causal define() into hook_init() and everything is fine.
Comment #3
Stuart Greenfield commentedGood spot. I've fixed this on branch DRUPAL-6--2, and it is also fixed in the development work on DRUPAL-6--3 pending the next commit.
Comment #4
vegardjo commentedHia Stuart!
First, thanks a lot for SWFTools, it really makes a huge difference!
However, this bug above actually got me again today, and I had to install the Purl patch on a different site too, to be able to still use SWFTools. I'm afraid I don't have the skills to patch SWFtools myself, but any chance you could roll a patch for this issue (or explain how to manually fix it) so we can have SWFTools work properly with Spaces / PURL?
Best, Vegard
Comment #5
dergachev commentedTripped me up too.. had to finally install Komodo for the debugging fun!
We have the 2.5 version of SWFTOOLS.
Comment #6
lefnire commentedWorks for me now, I had to cvs checkout swftools -dev (2.5's back in April). Any chance of adding a release for the -dev branches? Or mayhap tagging this puppy as a new release?
Comment #7
vegardjo commentedSeems the PURL patch (in addition to not being the right fix) also breaks Features beta 4. I did a CVS checkout of the 6.2 branch, found the fix, and manually updated my module. If someone else needs to fix this manually here's what you do:
in swftools.module, line 27, replace this line:
define('SWFTOOLS_DEFAULT_BG', url(drupal_get_path('module', 'swftools') . '/shared/swftools-default.jpg', array('absolute' => TRUE))); // A generic image for use in certain contextswith this:
define('SWFTOOLS_DEFAULT_BG', 'shared/swftools-default.jpg'); // A generic image for use in certain contexts...or you could probably just run the dev version, but I chose not to in case it would introduce other problems!
Thanks again for SWFTools :)
Comment #8
that0n3guy commentedMan, I wish I would have seen this before I spent hours trying to figure out how I screwed up my open atrium install.
subscribing
Comment #9
Stuart Greenfield commentedThis is fixed in 6.x-3.x.
Comment #10
pounardHello, I also experienced the bug and posted a quick and dirty patch at #960206: url() call outside any function context in swftools.module breaks some other modules init (duplicate bug). I'm posting this comment to have it appear on my dashboard and follow it.
Comment #11
fuzzy76 commentedReroll against 2.5 because I maintain old stuff and swftools haven't had a stable release since 2009. :-/