Attached patch gives users an idea why the tables they are looking at are empty. (Patch applies against comment, node, taxonomy, tracker.module).

This is an issue on http://urlgreyhot.com/wiki/pmwiki.php/Usability/Drupal4-4-1System

Comments

coreb’s picture

Version: x.y.z » 6.x-dev

Moving from x.y.z queue to 6.x-dev.

webchick’s picture

Category: feature » bug
Status: Active » Needs review
StatusFileSize
new903 bytes

Actually I just checked HEAD and all of these except tracker.module look to be already in core.

Here's a re-roll of tracker module.

This is more of a bug than a feature request, so moving to 5.x queue and re-filing as such.

webchick’s picture

Version: 6.x-dev » 5.x-dev

ahem. :P

RobRoy’s picture

Status: Needs review » Needs work

I noticed a lot of tables wrap em tags outside of the t() for empty table messages like

  if (count($rows) == 0) {
    $rows[] = array(array('data' => '<em>'. t('There are currently no access rules.') .'</em>', 'colspan' => 5));
  }

I kinda like the em better. You guys agree? If so we should re-roll so they are all consistent.

webchick’s picture

Status: Needs work » Needs review

Was this a reply to the wrong patch? There are no <em> tags in this patch, nor are there any in any of the other "No X available" messages that I could see (watchdog, taxonomy, system, path....)

RobRoy’s picture

That code above is from user module. Maybe it was a lot of contrib using em, I just feel like I've seen inconsistencies. So maybe the majority don't as I could only find that one in HEAD. Well, let's scrap that one that does use em in user.module then if we're going the sans-em route. Just wanted to bring up the consistency issue. So if you feel that deserves its own issue, let me know and I'll open a patch for removing that em separately.

webchick’s picture

Yeah, let's do that maybe (separate issue). This one is just a quick no-brainer. I agree though that it should be consistent, whatever it is.

neclimdul’s picture

This seems like a good patch but wanted to bring #94019 to the attention of this thread. It suggests changing "post" to "content" which would apply to the string in this patch as well. Chicken and egg as to which patch goes in first but I wanted to bring it to the attention of this thread.

webchick’s picture

This patch is currently consistent with what's displayed at admin/content/node. If you plan to change the word "post" to "content" throughout Drupal, that should also probably be a separate issue.

neclimdul’s picture

Status: Needs review » Reviewed & tested by the community

Nevermind, I think this is the right fix. Applied, works and looks good. RTBC

dries’s picture

Elsewhere in the code we write "if (!$rows)" rather than "if (!count($rows))". Maybe that could be used here as well? Would give you a bonus point for consistency. :)

neclimdul’s picture

@Dries would work except we should either do it as it is or use !isset($rows) and not initialize $rows for E_ALL reasons. Maybe even empty($rows)... if ($rows) in this case could lead to an initialized variable warning as mentioned in our coding standards. In fact, empty might be cheaper since we aren't actually using the number of rows for anything.

webchick’s picture

StatusFileSize
new897 bytes

Oh! Looks like if (!$rows) does work, even if $rows was initialized first (as it should be :P). Well that's cool.

Here's a re-roll.

webchick’s picture

StatusFileSize
new896 bytes

How about one without a parse error this time? :D

neclimdul’s picture

I'll be a monkey's uncle. Sorry Dries, didn't realize array() == false. Our E_ALL docs are misleading in this respect. Learn something new everyday.

Works fine in php4 and php5

dries’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)