On a fresh 4.5.0 installation, even just selecting the Administer-> Theme menu item breaks the theme stylesheets. For an example see http//hurricane.wagner.nyu.edu

Not sure what is causing this, but I've reinstalled and replicated on several different boxes.

CommentFileSizeAuthor
#1 Picture 1.pdf122.32 KBAnthony Townsend
Picture 2.pdf62.66 KBAnthony Townsend
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anthony Townsend’s picture

FileSize
122.32 KB

weirdly enough, the proper theme is used (and only there) on the Administer -> Theme selection page (see attached)

pildit’s picture

I've got the same symptoms.

Junyor’s picture

I've debugged the problem a bit. It seems that a null terminator is being inserted in the system table in the middle of the theme path.

See the following for related discussion:
http://drupal.org/node/4567
http://drupal.org/node/11761
http://drupal.org/node/12526
http://drupal.org/node/13005

Junyor’s picture

Here's the output from devel.module when loading admin/themes. The first query that shows a problem is "0.84 1 DELETE FROM system WHERE filename = 'themes/chameleon/chameleon\0theme' AND type = 'theme'", which comes from system_obtain_theme_info().

1.08 1 SELECT * FROM url_alias
1.37 1 SELECT name, filename, throttle, bootstrap FROM system WHERE type = 'module' AND status = 1
0.8 1 SELECT uid FROM authmap WHERE authname = 'tim'
0.96 1 SELECT u.* FROM users u WHERE u.uid = 18 AND u.status < 3 LIMIT 0, 1
0.84 1 SELECT r.rid, r.name FROM role r INNER JOIN users_roles ur ON ur.rid = r.rid WHERE ur.uid = 18
2.03 1 SELECT DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid INNER JOIN users_roles ur ON ur.rid = r.rid WHERE ur.uid = 18
1.65 1 SELECT * FROM system WHERE type = 'theme' ORDER BY name
6.47 1 SELECT data, created, headers FROM cache WHERE cid = 'menu:18'
1.27 1 DELETE FROM system WHERE type = 'theme_engine'
0.85 1 INSERT INTO system (name, type, filename, status, throttle, bootstrap) VALUES ('phptemplate', 'theme_engine', 'themes/engines/phptemplate/phptemplate.engine', 1, 0, 0)
0.75 1 INSERT INTO system (name, type, filename, status, throttle, bootstrap) VALUES ('xtemplate', 'theme_engine', 'themes/engines/xtemplate/xtemplate.engine', 1, 0, 0)
0.76 1 DELETE FROM variable WHERE name = 'phptemplate_extra_templates'
1.13 1 INSERT INTO variable (name, value) VALUES ('phptemplate_extra_templates', 'a:2:{s:14:\"themes/kubrick\";a:3:{s:30:\"themes/kubrick/comment.tpl.php\";O:8:\"stdClass\":2:{s:8:\"filename\";s:30:\"themes/kubrick/comment.tpl.php\";s:4:\"name\";s:11:\"comment.tpl\";}s:27:\"themes/kubrick/node.tpl.php\";O:8:\"stdClass\":2:{s:8:\"filename\";s:27:\"themes/kubrick/node.tpl.php\";s:4:\"name\";s:8:\"node.tpl\";}s:27:\"themes/kubrick/page.tpl.php\";O:8:\"stdClass\":2:{s:8:\"filename\";s:27:\"themes/kubrick/page.tpl.php\";s:4:\"name\";s:8:\"page.tpl\";}}s:12:\"themes/manji\";a:4:{s:24:\"themes/manji/box.tpl.php\";O:8:\"stdClass\":2:{s:8:\"filename\";s:24:\"themes/manji/box.tpl.php\";s:4:\"name\";s:7:\"box.tpl\";}s:28:\"themes/manji/comment.tpl.php\";O:8:\"stdClass\":2:{s:8:\"filename\";s:28:\"themes/manji/comment.tpl.php\";s:4:\"name\";s:11:\"comment.tpl\";}s:25:\"themes/manji/node.tpl.php\";O:8:\"stdClass\":2:{s:8:\"filename\";s:25:\"themes/manji/node.tpl.php\";s:4:\"name\";s:8:\"node.tpl\";}s:25:\"themes/manji/page.tpl.php\";O:8:\"stdClass\":2:{s:8:\"filename\";s:25:\"themes/manji/page.tpl.php\";s:4:\"name\";s:8:\"page.tpl\";}}}')
0.73 2 DELETE FROM cache WHERE cid = 'variables'
0.6 1 DELETE FROM variable WHERE name = 'phptemplate_extra_logic'
0.55 1 INSERT INTO variable (name, value) VALUES ('phptemplate_extra_logic', 'a:0:{}')
0.49 2 DELETE FROM cache WHERE cid = 'variables'
1.27 1 SELECT filename, type, status, throttle FROM system WHERE type = 'theme'
0.84 1 DELETE FROM system WHERE filename = 'themes/chameleon/chameleon\0theme' AND type = 'theme'
0.68 1 INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('chameleon', '', 'theme', 'themes/chameleon/chameleon\0theme', 0, 0, 0)
0.69 1 DELETE FROM system WHERE filename = 'themes/kubrick/page.tpl.php' AND type = 'theme'
0.67 1 INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('kubrick', 'themes/engines/phptemplate/phptemplate.engine', 'theme', 'themes/kubrick/page.tpl.php', 0, 0, 0)
0.68 1 DELETE FROM system WHERE filename = 'themes/manji/page.tpl.php' AND type = 'theme'
0.67 1 INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('manji', 'themes/engines/phptemplate/phptemplate\0engine', 'theme', 'themes/manji/page.tpl.php', 0, 0, 0)
0.67 1 DELETE FROM system WHERE filename = 'themes/bluemarine/xtemplate.xtmpl' AND type = 'theme'
0.66 1 INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('bluemarine', 'themes/engines/xtemplate/xtemplate.engine', 'theme', 'themes/bluemarine/xtemplate.xtmpl', 0, 0, 0)
0.68 1 DELETE FROM system WHERE filename = 'themes/pushbutton/xtemplate.xtmpl' AND type = 'theme'
0.66 1 INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('pushbutton', 'themes/engines/xtemplate/xtemplate\0engine', 'theme', 'themes/pushbutton/xtemplate.xtmpl', 1, 0, 0)
0.68 1 DELETE FROM system WHERE filename = 'themes/pushbutton-new/xtemplate.xtmpl' AND type = 'theme'
0.67 1 INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('pushbutton-new', 'themes/engines/xtemplate/xtemplate\0engine', 'theme', 'themes/pushbutton-new/xtemplate.xtmpl', 0, 0, 0)
0.67 1 DELETE FROM system WHERE filename = 'themes/chameleon/marvin/style.css' AND type = 'theme'
0.65 1 INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('chameleon/marvin', 'chameleon', 'theme', 'themes/chameleon/marvin/style.css', 0, 0, 0)
0.68 1 DELETE FROM system WHERE filename = 'themes/manji/obsidian/style.css' AND type = 'theme'
0.65 1 INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('manji/obsidian', 'manji', 'theme', 'themes/manji/obsidian/style.css', 0, 0, 0)
1 1 SELECT * FROM blocks WHERE (status = 1 OR custom = 1) ORDER BY weight, module

carlmcdade’s picture

The devel.module works on 4.5.2? or are you using a personally modified version?

Junyor’s picture

I used the CVS version. Worked fine.

TDobes’s picture

Very strange... I can't seem to reproduce this. Can sombody clarify the following questions so I might help troubleshoot the problem?
* Does this happen on CVS HEAD Drupal or is it limited to 4.5.x?
* What verion of PHP are you using? This forum topic seems to point to the idea that it might be related to old PHP versions.

Junyor’s picture

I've only seen this problem in that single installation of Drupal 4.5.2. I'll have to check the PHP version tomorrow. However, if you look at the last comment in that thread, it would appear that someone has the problem with PHP 4.3.9, too.

The problem started when one of the admins changed his account to use a different theme than the site default. I'm pretty sure I've done the exact same thing elsewhere and I haven't run into this problem.

Junyor’s picture

We're running 4.1.2.

Is there any way I can debug this?

TDobes’s picture

Junyor: You mentioned earlier that a null terminator is being placed in the theme path. Can you tell where it's being inserted? Does the null character always appear between the same elements in the path? Perhaps we can determine which function is causing the null character to be inserted and use a different function or a workaround.

Does this same problem occur in CVS HEAD? Drupal 4.6 (a.k.a. CVS HEAD at the moment) will work with the version of PHP you are using as long as you don't try the search.module. I believe the search module's handling of unicode has issues with older PHP versions due to some sort of PHP bug.

Junyor’s picture

Yes, the null character always occurs in place of the full stop in the theme name, i.e. "chameleon\0theme". The first function that outputs a faulty query is system_obtain_theme_info().

I'll do some testing this afternoon to see if the bug still occurs in HEAD.

Junyor’s picture

I took a database dump and a CVS checkout of the same files we're using for the problem install and I could not reproduce the problem. The server I tested with was using PHP 4.3.9, though.

Is there an easy way I can debug this in the same install that the problem occurs with without upgrading to HEAD?

mpearrow’s picture

FWIW, I am running 4.5.2, and PHP 4.1.2 and can consistently replicate the problem described in this thread. I'll be glad to provide whatever additional info would help, and I'd be willing to try a different version for debugging purposes.

mpj

Junyor’s picture

Can you replicate the problem with the current CVS checkout?

mpearrow’s picture

Using the cvs checkout, the problem does *not* exist. I've tried all of the things that make it break in 4.5.2 and I can't make it break. :)

mjp

Junyor’s picture

Then I guess we should consider this fixed in CVS until someone reproduces it there.

Anonymous’s picture