Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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>
?
Comment | File | Size | Author |
---|---|---|---|
#22 | 784842.drupal.blog-action-links.patch | 2.24 KB | joachim |
#18 | blog_actions.patch | 3.02 KB | NaheemSays |
#12 | blog_actions.patch | 1.81 KB | NaheemSays |
#9 | blog_action.patch | 1.6 KB | NaheemSays |
Comments
Comment #1
bleen CreditAttribution: bleen commentedsee this screenshot for reference: http://skitch.com/bleen/dbdf4/bleens-blog-d7
Comment #2
jensimmons CreditAttribution: jensimmons commentedthat image ^ embedded:
Comment #3
jensimmons CreditAttribution: jensimmons commentedComment #4
joachim CreditAttribution: joachim commentedThey 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 :/
Comment #5
NaheemSays CreditAttribution: NaheemSays commented@ Joachim - is that still the case? I thought it was fixed with #542658-79: Move action "tabs" out of local tasks
Comment #6
joachim CreditAttribution: joachim commentedDries committed that on December 3, 2009 and I updated my CVS checkout of D7 in the last few days -- so I'd say no :)
Comment #7
kika CreditAttribution: kika commentedGuys, "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.
Comment #8
joachim CreditAttribution: joachim commented> 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.
Comment #9
NaheemSays CreditAttribution: NaheemSays commentedThis should work.
Comment #10
bleen CreditAttribution: bleen commentedI 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
white space
Powered by Dreditor.
Comment #11
bleen CreditAttribution: bleen commentedComment #12
NaheemSays CreditAttribution: NaheemSays commentedUpdated patch
Comment #13
bleen CreditAttribution: bleen commentedMuch gooder! ... lets let testbot chomp on this patch
Comment #15
NaheemSays CreditAttribution: NaheemSays commentedAny 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.
Comment #16
joachim CreditAttribution: joachim commentedI 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.
Comment #17
bleen CreditAttribution: bleen commentedAgreed ... in a situation like this, it is perfectly appropriate to change the test.
Comment #18
NaheemSays CreditAttribution: NaheemSays commentedI have changed the text to make sure there is no "create new blog entry" text in such a case.
Comment #19
joachim CreditAttribution: joachim commentedWhat's this bit for? Doesn't seem connected with anything else in the patch.
86 critical left. Go review some!
Comment #20
joachim CreditAttribution: joachim commentedRegarding the 'you may not...' link, I've just seen forum module does this:
(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.
Comment #21
NaheemSays CreditAttribution: NaheemSays commented@ 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.
Comment #22
joachim CreditAttribution: joachim commented> @ 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.
Comment #24
NaheemSays CreditAttribution: NaheemSays commentedThe 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?
Comment #25
bleen CreditAttribution: bleen commented#671452: Blog Actions CSS will cover this issue .. marking accordingly (thx nbz)