I've poked around a bit and haven't figured out why yet, but even when 'Display post information on...' on the admin/build/themes/settings page is disabled, the theme still outputs the 'submitted by' text. $vars['submitted'] is apparently being set before it reaches template.php, but not sure exactly where... Switching to another theme fixed the problem, but Zen and subthemes all show the 'submitted by' text.

Comments

BioBen’s picture

Couldn't you just display none with CSS?
Maybe I'm not understanding the question.

matt@antinomia’s picture

Sure that would 'work', but it sounds like a clunky workaround... Drupal has a feature which turns the 'submitted by' text off via the theme settings page, and the Zen theme should respect this setting.

Dig your web site BTW, BioBen! :)

johnalbin’s picture

Title: Zen shows 'submitted by' text ($vars['submitted'] if setting is disable » 'Submitted by' text is shown even if setting is disabled
Status: Active » Fixed

This was probably fixed when the fix for #171201 was committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

burlap’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

The problem persists for book pages - doesn't matter whether beta or dev (as of Jan 16) is used. Date is displayed correctly.

johnalbin’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

The problem persists for book pages - doesn't matter whether beta or dev (as of Jan 16) is used. Date is displayed correctly.

So you would like the date to display incorrectly?!?

Also, Zen doesn't treat book pages differently than other content types. So that must be a customization you made to Zen. If you have a node-book.tpl.php file, it didn't come from Zen.

burlap’s picture

1. The problem in this issue concerns "submitted by", date was a side-issue. And it's fixed, while "submitted by" doesn't seem to be. Which means that suggestion in #3 didn't work - fixing date didn't fix submitted by. And it doesn't mean I'd like to display date incorrectly.

2. I don't have any node-book.tpl.php files for zen. For that matter, no php code has been changed in either node.tpl.php ot page.tpl.php. I don't know how customizing CSS could affect this issue. It's possible it's a book (drupal) bug, but I haven't modified any drupal files either.

johnalbin’s picture

Sorry, I misunderstood what you were trying to say in #5.

Submitted by text is configurable per content type. Likely, you just enabled the book module, but didn't uncheck the “Display post information on” checkbox for Book pages on the /admin/build/themes/settings form.

Also, any content type can be added to a book outline and so will appear in a book, but that content type will use its own “Display post information on” and not use the setting for Book pages.

burlap’s picture

I disabled "display information" for every content type, just to make sure.

I tried to follow this kind of reasoning too - creating other content types instead of "book page", because disabling "submitted by" works for them. There was another issue with this - unrelated to Zen or this issue - I don't know how to make "Add child page" add parent content type instead of a book page (and I'd like to keep this "Add" link)...

But I followed your other suggestion and I actually created node-book.tpl.php, where I removed "submitted by" part...

geoffff’s picture

I'm also seeing the very same problem. $submitted is being set somewhere for Book Page nodes. For now I've also added a node-book.tpl.php file as a workaround. (Thanks!)

-- Geoff

cheriejd’s picture

Where is "Submitted by" text being set? I want to change the text to posted by. Where can I do that? My searches have all come up empty.

Anonymous’s picture

Title: 'Submitted by' text is shown even if setting is disabled » 'Submitted by' text is shown for book pages even if setting is disabled

I am also seeing this, with Zen classic 5.x-1.0 and Drupal 5.7; no theme modifications or other PHP hacking.

matt@antinomia’s picture

Status: Closed (fixed) » Active

Sorry to re-activate this, but I can confirm this is a bug in the 5.x-1.0 and the 5.x-1.x-dev releases for zen, zen_classic, and STARTERKIT. The issue disappears when I switch to garland.

I've tried against a new installation with no other modules or themes enabled, and the issue persists. :\

Running PHP 4.4.6.

matt@antinomia’s picture

Confirmed in PHP 5.2.3 as well.

johnalbin’s picture

Status: Active » Postponed (maintainer needs more info)

I’ve looked at this again. And I still can’t replicate the problem.

When I turn off “Display post information on...” for book pages on the admin/build/themes/settings the “Submitted by” text disappears on book pages.

Since there are multiple reports of this, I believe you guys, but its just weird that I don't see the issue.

johnalbin’s picture

Title: 'Submitted by' text is shown for book pages even if setting is disabled » 'Submitted by' text is shown for content even if setting is disabled
Status: Postponed (maintainer needs more info) » Fixed

Ok, I’ve replicated the problem.

This bug is caused by the theme-settings-init.php code. When you haven’t been to the theme settings page, that code grabs the defaults from theme_get_settings(), merges them with the defaults and then stores it into the db. Unfortunately, the call to theme_get_settings() returns the settings for the node type “submitted” settings. But those settings aren’t supposed to be saved per-theme. So if we later change the default “submitted” settings, the values stores in the db for our specific theme will override them.

So there are 2 things you need to do:

  1. To fix the problem now (temporarily), go to admin/build/themes/settings/THEME and click on the “Save configuration” button. But if you ever change the “submitted” settings again, you’ll see the bug again.
  2. To fix the problem permanently, edit the theme-settings-init.php files and change:
      // Save default theme settings
      variable_set(
        str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
        array_merge($defaults, theme_get_settings($theme_key))
      );
    

    to:

      // Get default theme settings.
      $settings = theme_get_settings($theme_key);
      // Don't save the toggle_node_info_ variables.
      if (module_exists('node')) {
        foreach (node_get_types() as $type => $name) {
          unset($settings['toggle_node_info_' . $type]);
        }
      }
      // Save default theme settings.
      variable_set(
        str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
        array_merge($defaults, $settings)
      );
    

    I’ve committed this change to the -dev version.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.