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.
Line 61: Change user_access('edit own blog') to user_access('edit own blog entries')
I was wondering why the create blog entry link was not shown for my users. The above seems to be the problem.
Comment | File | Size | Author |
---|---|---|---|
#18 | blog.pages_.inc_D6.patch | 633 bytes | wanjee |
#14 | 290887-create-blog-content-link-D7.patch | 1.31 KB | Dave Reid |
#13 | blog-perm.patch | 642 bytes | Jody Lynn |
#10 | blog.pages_.inc_.patch | 642 bytes | Dave Reid |
#8 | blog.pages_.inc__2.patch | 628 bytes | Dave Reid |
Comments
Comment #1
wanjee CreditAttribution: wanjee commentedSame problem here using Drupal 6.9.
I think this should be fixed as it is the only place where 'edit own blog' is specified.
The only required change is on line 61 of blog.pages.inc file.
if (user_access('edit own blog')) {
should become
if (user_access('edit own blog entries')) {
It is stated in comment of system_update_6045() function that
Hope to hear from someone for a positive feedback or a explanation on how it is like that.
Regards,
Seb
Comment #2
wanjee CreditAttribution: wanjee commentedSo here is the patch to allow roles with "edit own blog entries" permission to get the link in top of the /blogs page.
Hope it's ok as it is my first one.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedWhile the patch is good we need to roll it against CVS head first. Can you please reroll the patch for D7?
Comment #4
wanjee CreditAttribution: wanjee commentedHere is the new version.
The fix is different as the correct permission in D7 seems to be 'edit own blog content' instead of 'edit own blog entries' so I have made this little change in new patch.
Regards
Comment #5
Dave ReidComment #7
wanjee CreditAttribution: wanjee commentedI don't see any syntax error in the patch. Is this a test error ?
Regards
Comment #8
Dave ReidHmm...there was an extra newline at the end of the patch file. Let's try this one.
Comment #10
Dave ReidHmm...I rolled a new patch myself and fixed the permission to use the correct one 'create blog content', since the link that is used is for creating new blog content, and not editing it.
Comment #11
wanjee CreditAttribution: wanjee commentedSure you are right, 'create blog content' is far better.
So I guess 'create blog entries' will be the correct permission in 6.x
Thanks for reviewing this.
Regards,
Seb
Comment #13
Jody LynnRetest.
Comment #14
Dave ReidThis time with an added assertion in blog.test that I've confirmed fails before the patch, and passes with the patch. Yay! Let's get this reviewed and fixed!
Comment #15
Jody LynnLooks good to me.
Comment #16
Dries CreditAttribution: Dries commentedComimtted to CVS HEAD. Thanks.
Comment #17
Jody LynnNeeds a re-roll for the backport, without the test.
Comment #18
wanjee CreditAttribution: wanjee commentedRe-roll for Drupal 6.
Hope it's ok.
Regards,
Wanjee
Comment #19
Jody LynnLooks good.
Comment #20
Gábor HojtsyYes, for Drupal 6, the good permission is "create blog entries". From system.install's update docs:
Committed to Drupal 6, thanks!