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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wanjee’s picture

Version: 6.3 » 6.9

Same 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

* Blog module got "edit own blog" replaced with the more granular "create
* blog entries", "edit own blog entries" and "delete own blog entries"
* permissions. (...)

Hope to hear from someone for a positive feedback or a explanation on how it is like that.

Regards,

Seb

wanjee’s picture

Status: Active » Needs review
FileSize
1.38 KB

So 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.

Anonymous’s picture

Version: 6.9 » 7.x-dev
Status: Needs review » Needs work

While the patch is good we need to roll it against CVS head first. Can you please reroll the patch for D7?

wanjee’s picture

FileSize
682 bytes

Here 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

Dave Reid’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch failed testing.

wanjee’s picture

I don't see any syntax error in the patch. Is this a test error ?

Regards

Dave Reid’s picture

Status: Needs work » Needs review
FileSize
628 bytes

Hmm...there was an extra newline at the end of the patch file. Let's try this one.

Status: Needs review » Needs work

The last submitted patch failed testing.

Dave Reid’s picture

Status: Needs work » Needs review
FileSize
642 bytes

Hmm...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.

wanjee’s picture

Sure 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

Status: Needs review » Needs work

The last submitted patch failed testing.

Jody Lynn’s picture

Status: Needs work » Needs review
FileSize
642 bytes

Retest.

Dave Reid’s picture

This 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!

Jody Lynn’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

Dries’s picture

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

Comimtted to CVS HEAD. Thanks.

Jody Lynn’s picture

Status: Reviewed & tested by the community » Needs work

Needs a re-roll for the backport, without the test.

wanjee’s picture

Status: Needs work » Needs review
FileSize
633 bytes

Re-roll for Drupal 6.

Hope it's ok.

Regards,

Wanjee

Jody Lynn’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Yes, for Drupal 6, the good permission is "create blog entries". From system.install's update docs:

Blog module got "edit own blog" replaced with the more granular "create blog entries", "edit own blog entries" and "delete own blog entries"

Committed to Drupal 6, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.