Resources

My Agape try

Your Agape try


Please Follow this Workaround for Category Role Stability

Last Saturday, a faithful support forum participant reported a bizarre bug involving Category checkboxes on the WordPress Post Edit form.  Role Scoper adds "Readers", "Contributors" and "Editors" boxes - each containing checkboxes to grant access to a specific User or Group.  It seems that some of these checkboxes, when clicked, caused one of the Category checkboxes to be (un)checked accordingly.  Obviously, this is a major bug for sites using Category Roles.

I tracked this error to the WordPress javascript!  WP 2.9 includes a change in wp-admin/js/post.js which makes any plugin-inserted checkbox array an involuntary vehicle of this error.  I have submitted a ticket in the WordPress bug tracking database, but don't know whether it will be corrected in the WP 2.9 branch.  To manually patch your installation, edit wp-admin/js/post.dev.js as follows:

change:

$('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c );

to:

if ( id && t.parents('#categorydiv').length )
  $('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c );

Then rename post.dev.js to post.js

Comments

Comment from victar
Time: February 18, 2010, 3:33 pm

Ah hah! So that's what was happening.

Comment from Dermod
Time: March 4, 2010, 5:35 pm

Hi there

I don't use role scoper for Category Roles. However, on the edit post panel, the categories do not appear in the panel on the right when a user with the role of Editor is editing or writing a post.

I've checked that an Editor does see the category list while writing a new post, when Role Scoper is disabled.

Is this the same bug as the one above, or should I post it anew?

Thanks

Dermod

Comment from Kevin
Time: March 4, 2010, 6:51 pm

Dermod - no, it's not the same bug. I see your post in the support forum and will discuss there.

Comment from Jason
Time: March 17, 2010, 5:49 am

I was attempting this fix but when I went to save the post.dev.js file to post.js I realized that my WordPress installation already has a file named post.js in the same directory. Should I overwrite this file?? Thanks in advance and thanks for the great plugin.

Comment from Kevin
Time: March 20, 2010, 10:13 pm

Jason, Just to be safe you can first rename the existing post.js in case you need to roll back.

Comment from Jason
Time: March 22, 2010, 8:53 am

Thanks Kevin I'll try that

Comment from Loring
Time: March 30, 2010, 10:25 am

ah ! thanks

Write a comment

(But if your comment is a usage question, bug report or feature request, please post it in the Support Forum instead.)