This is a quick fix. One which would make node.module a bit smarter when an anonymous user clicks on the submit button.



Currently, they get nothing but the phrase:

"Choose the appropriate item from the list:"



The fix is simple. On or about line 1159, where it reads:
$output = t("Choose the appropriate item from the list:") ."<ul>$output</ul>";



Test for the length of $output.





if(strlen($output)) {

$output = t("Choose the appropriate item from the list:") ."<ul>$output</ul>";

} else {

$output = t('You must first <a href="/drupal/user/register">create a new account</a>');

$output .= t('<br />before you can submit content to our site.');

}

Comments

MeanDean’s picture

Well, it'd probably be a smarter (and more Drupal compliant) "alternate no output" message if it read:


$output = t('You must first '. l("register a new account","user/register"));
$output .= t('<br>before you can submit content to '.variable_get("site_name", "this site").'.');

moshe weitzman’s picture

Smarter, yes. But more Drupal compliant? You don't usually want to pass the
value of a variable through the t() function. So this is better ...

$output .= "
". t("before you can submit content to %s.", array ("%s"
=> variable_get("site_name", "this site")));

Also, you can omit the strlen() from the original proposal and just use

if ($output)

jonbob’s picture

The submit link is no longer present for non-privileged users.

Anonymous’s picture