Guys,

If i enable the Author Information block, the user picture only is displayed IF another profile field is created and displayed too. If i deselect all fields, the picture is gone too. I can let only the user page link, with no difference.

regards,

massa

CommentFileSizeAuthor
#1 theme_profile_block.patch4.66 KBPancho
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Pancho’s picture

Title: D6: User picture on author info block » No profile link and no picture without profile fields
Status: Active » Needs review
FileSize
4.66 KB

Yes, I consider this a bug. The if (!empty($fields)) check in profile_block is too strict. It should show the block, if any element can be displayed, which may also be the user picture or the link to the profile page. I therefore changed the check to if (!empty($profile) || $picture || $profile_link). Admins can further restrict this in the theme layer, the other way around this was not possible.

At the same time, there is another problem with profile_block: The rendering of the user page link is hardcoded and appended to the themed output. Instead it should be themeable as well. I therefore moved the url composition to the preprocess layer (template_preprocess_profile_block) and the link creation to the theme layer (profile-block.tpl.php).

What I wasn't sure about is why a parameter TRUE is being appended when calling the theme function in line 181 (now: 183). I guessed this means "end of arguments", so I let it in, but maybe someone can bring this to my mind...

brmassa’s picture

Status: Needs review » Reviewed & tested by the community

Bernd,

Your patch works fine.

massa

PS: there is another issue that might be subject for another report, but... Since all sites that use this block needs some pages that are from the Admins (like "about", "welcome apge", etc), selecting on which node types this block is displayed is a requirement. No one wants to show that the "admin" created all these nodes.

Pancho’s picture

Status: Reviewed & tested by the community » Needs review

@brmassa: Well, that is surely something for a contrib module, as new features won't go into D6 anymore. As far as pages (like "about", "welcome page" etc.) are concerned, this is no problem, though: You just need to create these pages with the nodetype "page" instead of "article". Then the line with author & creation date isn't displayed by default.

Let's focus on this issue first, but feel free to file another issue for the other one against D7. This needs more reviews though, so I set it back to CNR.

brmassa’s picture

Bernd,

about the patch: its working, as i said. Well... there is no option to either use or not the user picture, the arguments listed on hook_theme are not the same and i dont know much why using template_preprocess_profile_block() while it can be calculated before, but its mainly working.

about the "new feature": once you enable this block, it will be displayed on EVERY page/content created. It is probably a undesired effect that might turn the whole feature unusable. Its not about the "submitted by" tag on stories and page node types. But i understand about new features on D6. I will start a new issue so day.

regards,

massa

brmassa’s picture

Gabor, ping! :P

dpearcefl’s picture

Is this still an issue using current Drupal 6?

Status: Needs review » Needs work

The last submitted patch, theme_profile_block.patch, failed testing.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.