Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
After updating to latest .dev I got;
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in _zurb_foundation_load() (line 20 of /sites/all/themes/zurb-foundation/template.php).
greetings, Martijn
Comment | File | Size | Author |
---|---|---|---|
#11 | 1899620-undefined-constant-dir-11.patch | 559 bytes | chrisjlee |
#8 | 1899620-undefined-__DIR__-07.patch | 515 bytes | jedihe |
Comments
Comment #1
chrisjlee CreditAttribution: chrisjlee commented@Martijn: Are you using php 5.2 ?
Comment #2
Summit CreditAttribution: Summit commentedHi,
Yes I am using PHP 5.2.4
Greetings, Martijn
Comment #3
chrisjlee CreditAttribution: chrisjlee commentedMartijn:
Thanks for reporting this. I went ahead and committed a fix. Let me know if solves your issue by performing an update to the latest version. I'm pretty confident it will.
Commit:
http://drupalcode.org/project/zurb-foundation.git/commit/cb276e3cf583ef5...
FYI: For those who are googling this issue; __DIR__ is a magic constant only supported in php 5.3 +.
Comment #4
r4dian CreditAttribution: r4dian commentedThe workaround didn't work for me but manual replacement of "__DIR__" to "__FILE__" did the trick. Thanks.
Comment #5
chrisjlee CreditAttribution: chrisjlee commentedThanks. work on find another solution.
Comment #6
chrisjlee CreditAttribution: chrisjlee commented...
Comment #7
jedihe CreditAttribution: jedihe commentedAccording to the PHP documentation, defined() and define() take a string for the constant; I'm attaching a patch to fix that.
Comment #8
jedihe CreditAttribution: jedihe commentedAttaching file missing on previous comment.
Comment #9
Summit CreditAttribution: Summit commentedHi, #8 worked for me on PHP 5.2.4 !
greetings, Martijn
Comment #10
ishmael-sanchez CreditAttribution: ishmael-sanchez commentedFor the record, based on http://drupal.org/requirements 5.3 is recommended and some modules require 5.3 so I don't think it's unreasonable to have a theme require 5.3 and Drupal 8 will require 5.3.
July 22 2010 per http://www.php.net/archive/2010.php#id2010-07-22-1
Comment #11
chrisjlee CreditAttribution: chrisjlee commentedI went ahead and actually removed the work around. Commit: http://drupalcode.org/project/zurb-foundation.git/commit/3d7b46c
For those who want to continue to use the zurb theme but are still using php 5.2, attached is a rerolled patch.
Thanks @jedihe for the patch.
I also updated the project page to inform of the requirements and the patch that is available for the time being.
Comment #12
dylanthomas CreditAttribution: dylanthomas commentedWeird occurrence for me, my fault, I set the PHP version back and removed a php.ini file from the root thinking it wasn't needed - turns out I was wrong, a few hours later.... I tried uninstalling and reinstalling twice, I was getting this exact error - using 1&1 shared hosting - turns out Global PHP settings to 5.4 was the 1st step to fixing this, the 2nd was setting Local PHP settings to 5.4 (New Local PHP Version) and apply it to the root directory, no error no more.
Comment #13
chrisjlee CreditAttribution: chrisjlee commentedThanks for your helpful report DylanThomas!
Comment #14
dylanthomas CreditAttribution: dylanthomas commentedToo much coffee if I recall!
Comment #15
alexweber CreditAttribution: alexweber commentedThis actually got committed a while ago: #2001046: Don't require PHP 5.3
Marking as duplicate.