I hope I'm posting this in the right place. After troubleshooting my issue, I've narrowed it down to the contemplate module. I developed a site on a windows xp machine with XAMPP as my environment, using contemplate. Once it was ready to go, I moved it onto a webserver with a similar setup. Now, if contemplate is enabled, things get weird. I'm not too sure if its a problem with my server setup or with contemplate. Here's the story, I'll try to make it brief.
Details of current setup:
os: centos 4.3
apache: 2.0.52
mysql: 4.1
php: 4.3.9
drupal: 4.7.3
contemplate: 1.5 2006/06/22
other non-core modules: there are many, but I believe the relevant ones are cck, imagefield, imagecache, views
themes: spreadfirefox, bluemarine
Summary of issue:
if contemplate is enabled, using spreadfirefox theme:
- able to access admin > content > templates > edit (node type in question)
- views which generate teaser view are ok (including img src)
- full node view's img and a tags point to an non-existent url, images are broken, links go to 404
-- here's the weird part: if I look at the page source from my browser on full node view, the img src values are correct - but viewed from the browser the are incorrect - this applies to both IE, Firefox and Opera (cache and cookies cleared on browsers)
if contemplate is enabled, using bluemarine theme:
- unable to access edit template page, instead get an un-rendered view of the body of one node, drupal interface is not shown at all
- views which generate teaser view render the same as edit template page, but with a different node
- full node view's img and a tags point to an non-existent url, images are broken, links go to 404
if contemplate is disabled, all themes/views work normally.
Details:
It doesn't seem to be an issue with views, imagefield, cck or imagecache. If I generate a table or list view, the view displays normally.
The main change with the setup is that in XAMPP, the site had the docroot, on my webserver, it's in a subdirectory.
teaser code:
<div class="primary-image">
<?php foreach ((array)$field_primary_image as $item) {
if (empty($item['filepath'])) continue; ?>
<a href="node/<?php print $nid ?>">
<img src="files/imagecache/thumbnail/<?php print $item['filepath'] ?>" alt="<?php print $item['alt'] ?>" title="<?php print $item['title'] ?>" />
</a>
<?php } ?>
</div>
output from firefox with spreadfirefox theme:
<div class="primary-image">
<a href="node/78">
<img src="files/imagecache/thumbnail/files/catalog_images/III-G-1502.jpg" alt="III-G-1502.jpg" title="III-G-1502.jpg" />
</a>
</div>
The link in firefox is correct: it points to http://mysite.ca/subdir/node/78
output from firefox for bluemarine theme:
<div class="primary-image">
</div>
In fact, using bluemarine, my total output from the browser is under 30 lines! Nothing from drupal, just partial contents of my cck node.
body code:
<?php foreach ((array)$field_primary_image as $item) {
if (empty($item['filepath'])) continue; ?>
<div class="primary-image">
<img src="files/imagecache/preview/<?php print $item['filepath'] ?>" alt="<?php print $item['alt'] ?>" title="<?php print $item['title'] ?>" /><br>
<span class="links">
<a href="files/imagecache/thumbnail/<?php print $item['filepath'] ?>">Thumb</a>
<a href="files/imagecache/preview/<?php print $item['filepath'] ?>">Preview</a>
<a href="files/imagecache/presentation/<?php print $item['filepath'] ?>">Presentation</a>
<a href="<?php print $item['filepath'] ?>">Original</a>
</span>
</div>
<?php } ?>
output from firefox with spreadfirefox theme:
<div class="primary-image">
<img src="files/imagecache/preview/files/catalog_images/III-G-1502.jpg" alt="III-G-1502.jpg" title="III-G-1502.jpg" /><br>
<span class="links">
<a href="files/imagecache/thumbnail/files/catalog_images/III-G-1502.jpg">Thumb</a>
<a href="files/imagecache/preview/files/catalog_images/III-G-1502.jpg">Preview</a>
<a href="files/imagecache/presentation/files/catalog_images/III-G-1502.jpg">Presentation</a>
<a href="files/catalog_images/III-G-1502.jpg">Original</a>
</span>
</div>
The link in firefox in NOT correct, it adds a 'node/' to the path where there should not be one.
http://mysite.ca/subdir/node/files/imagecache/thumbnail/files/catalog_images/III-G-1502.jpg
With bluemarine, the output is the same as with spreadfirefox for full node view.
While diagnosing this issue, I've cleared drupal's cache, disabled eaccelerator on my server, set the $base_url in the settings.php file - no help. I'm thoroughly confused by this - I'm really hoping that I'm just overlooking something. I'm going to attempt to offload the templates to tpl files for now, but I'd love to know why this is happening.
Cheers,
Ian
Comments
Comment #1
whereisian commentedIt seems to be a problem with my server setup. Watchdog shows:
mime_magic: invalid mode 027770154060. in /var/www/html/subdir/modules/imagecache/imagecache.module on line 137.While the error shows imagecache, I can't reproduce with contemplate disabled.
Comment #2
whereisian commentedSorry - I realize now I should have posted this in the forums. I'll reopen should anything more relevant appear.
Comment #3
whereisian commentedForum topic opened here : http://drupal.org/node/86398 Thanks.