this is the current html for the "post new blog entry" link that is generated by blog.module:

 <div class="item-list"><ul><li class="first last"><a href="/node/add/blog">Post new blog entry.</a></li>
</ul></div>

Like the "add user" link (/admin/people) shouldn't it be:

 <div class="item-list"><ul class="action-links"><li class="first last"><a href="/node/add/blog">Post new blog entry.</a></li>
</ul></div>

?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bleen’s picture

see this screenshot for reference: http://skitch.com/bleen/dbdf4/bleens-blog-d7

jensimmons’s picture

that image ^ embedded:

a screenshot of the link in question

jensimmons’s picture

Issue tags: +Bartik
joachim’s picture

They should.... but they are made completely differently:

The 'add user' link is made by hook_menu as a MENU_LOCAL_ACTION.

The 'add blog' link is hardcoded HTML at the top of the blog page callback, blog_page_user().

So we're looking at spoofing that class in to the 'add blog' link, which is sort of a kludge :/

NaheemSays’s picture

@ Joachim - is that still the case? I thought it was fixed with #542658-79: Move action "tabs" out of local tasks

joachim’s picture

Dries committed that on December 3, 2009 and I updated my CVS checkout of D7 in the last few days -- so I'd say no :)

kika’s picture

Guys, "post new blog entry" what you are witnessing here is nothing but a historical landmark: a contextual action link introduced in Nov 24 2004 to Drupal (commit here, the original issue here #10990: Add "new blog post" link to the top of user blog pages). According to a timeline, it was likely Drupal 4.5.

There were the dark days when usability was a still a novelty word in Drupal. Yes, it was hardcoded and never properly abstracted but nevertheless important. It was a total break from the usual "drupal is mo-du-lar, go see /node/x to view, /node/x/edit to edit, /node/add/x to add" robot talk and actually offered a right link in a right place for users.

Unfortunately as there is almost no attention to blog.module any more, that small mighty link never go converted to D7 action links (what it essentially is, way ahead of its time).

So, yes, it needs proper conversion not CSS-faking.

joachim’s picture

> So, yes, it needs proper conversion not CSS-faking.

I'm not sure we can do that, since the link it gives already exists elsewhere in the menu structure.

NaheemSays’s picture

Status: Active » Needs review
FileSize
1.6 KB

This should work.

bleen’s picture

Status: Needs review » Needs work

I get an error then I visit http://d7/blog/uid

Fatal error: Unsupported operand types in .../modules/blog/blog.pages.inc on line 32

...also

+++ modules/blog/blog.module	2010-04-30 01:23:38.533400000 +0100
@@ -137,8 +137,10 @@ function blog_menu() {
+  ¶

white space

Powered by Dreditor.

bleen’s picture

NaheemSays’s picture

Status: Needs work » Needs review
FileSize
1.81 KB

Updated patch

bleen’s picture

Much gooder! ... lets let testbot chomp on this patch

Status: Needs review » Needs work

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

NaheemSays’s picture

Any suggestions on how to fix the test failure?

The problem is the new patch does not show a "You are not allowed to post a new blog entry." in the case where the user does not have permission to create blog posts - it just does not show the link to create a new blog post.

joachim’s picture

I would say the test needs changing.

The menu system can't show you links you don't have access to. And anyway, showing you a text saying something you can't do is rather odd.

bleen’s picture

Agreed ... in a situation like this, it is perfectly appropriate to change the test.

NaheemSays’s picture

Status: Needs work » Needs review
FileSize
3.02 KB

I have changed the text to make sure there is no "create new blog entry" text in such a case.

joachim’s picture

Status: Needs review » Needs work
+++ modules/blog/blog.pages.inc	2010-04-30 18:54:09.772500000 +0100
@@ -42,6 +27,8 @@ function blog_page_user($account) {
+  $build = array();
+

What's this bit for? Doesn't seem connected with anything else in the patch.

86 critical left. Go review some!

joachim’s picture

Regarding the 'you may not...' link, I've just seen forum module does this:

        // Authenticated user does not have access to create new topics.
        if ($user->uid) {
          $links['disallowed'] = array(
            '#theme' => 'menu_local_action',
            '#link' => array(
              'title' => t('You are not allowed to post new content in the forum.'),
            ),
          );
        }

(over at #786620: Regression: Add new forum topic not visible within a forum).

So maybe we should too, when the user is looking at their own blog but may not post there.

NaheemSays’s picture

@ comment 19 - the end of the function has a return return $build; so we need to make sure it is always initialised and it fixes the fatal error reported in comment 10.

The other option was to remove the + to where the array is added to ($build += ...) but that was inside an if statement so I thought this was cleaner.

joachim’s picture

Status: Needs work » Needs review
FileSize
2.24 KB

> @ comment 19 - the end of the function has a return return $build; so we need to make sure it is always initialised and it fixes the fatal error reported in comment 10.

Sure, but it seems unrelated to the changes we are making here -- it's in a function we don't touch apart from that.

Here's a new pach, without that change, with the 'you may not' link, and *with* the test kept in as it should now pass.

Status: Needs review » Needs work

The last submitted patch, 784842.drupal.blog-action-links.patch, failed testing.

NaheemSays’s picture

The patch over at #671452: Blog Actions CSS has passed the tests, but I have not had a chance to test.

Should this issue be marked duplicate?

bleen’s picture

Status: Needs work » Closed (duplicate)

#671452: Blog Actions CSS will cover this issue .. marking accordingly (thx nbz)