I was looking at the HTML output of a theme I am building around sympal when I noticed that my published stories have <div class="article story unpublished"></div> set. When I looked at node.tpl.php I saw on line 1:

<div class="article<?php print " $type"; print ($sticky ? " sticky" : NULL); print (!$sticky ? " unpublished" : NULL); ?>"></div>

So even though a story is published the class says "unpublished".

Comments

Bèr Kessels’s picture

Version: 5.x-1.x-dev » 4.7.x-1.x-dev

Fixed in 5.x.
I need to backport this to 4.7 too.

Bèr Kessels’s picture

Status: Active » Fixed

fixed in 4.7 too. Thanks for the report!

Just our of curiosity: is the site with your theme online? I love to see what people manage to craft from this theme.

samirnassar’s picture

I am working on the theme locally for my site. When it is ready to go I'll give you a heads up. Thank you for fixing the bug so fast. I'll make sure to report any other buglets if I find them.

samirnassar’s picture

After downloading the updated sources and checking that the changes in node.tpl.php are there I checked the raw HTML and unpublished is still there.

So I added more content and that also is shows no changes.

Lastly, I unpublished and republished from the admin interface and the results are the same.

Caching is turned OFF.

Any ideas?

samirnassar’s picture

I investigated some more and changed line 1 of node.tpl.php to:

<div class="article<?php print " $type"; print ($sticky ? " sticky" : NULL); print ($published ? " published" : " unpublished"); ?>"></div>

When I reloaded I got unpublished in the class for the posts. Is it possible that $published isn't getting set?

Bèr Kessels’s picture

Yes. This can be. I assumed that all $node->namespace were turned into $namespace, but might have been wrong.

Can you confirm that $published is empty? Can you also check that against $node->published?

Bèr

Bèr Kessels’s picture

Status: Fixed » Postponed (maintainer needs more info)