Closed GoogleCodeExporter closed 8 years ago
Thanks for the bug report.
there are a couple glitches that have been brought to my attention: one fix is to re-save your content type definitions (just edit them and then save them again).
The other has to do with the way WP handles the post-type registration, so you
may want to try the dev version on http://wpcctm.com/cctm-dev.zip -- I'm
working on a fix there for what I believe is a related issue.
Original comment by fireproofsocks
on 8 Oct 2011 at 3:01
UPDATE 2
I installed the dev version referred to in the email, No change in the issue -
Role scoper still does not recognize the Content Type.
Also there is one more bug that was present in 0.9.3, Role Scoper prevents
WordPress Custom-Content-Type-Manager menu from appearing in the left nav of
WordPress. To access the menu you have to browse to plugins section and then
choose the settings URL.
UPDATE 2
I did try to resave the definitions, in fact after the update the custom
content type would no show in the admin menu until the each screen was resaved.
I'll try the dev version and see what happens.
Original comment by pswsa...@gmail.com
on 8 Oct 2011 at 3:58
Well, part of the problem has to do with the Role Scoper plugin... it's got
unhandled notices e.g.
Notice: Trying to get property of non-object in
/path/to/html/wp-content/plugins/role-scoper/admin/admin_rs.php on line 185
The other thing is me trying to deal with WP's insane arguments to the
register_post_type() function... using the get_post_types() function doesn't
recognize public post types when they are registered verbosely using the
attributes represented by the public argument:
In other words, if public = true, then
publicly_queriable = true;
show_ui = true;
show_in_nav_menus = true;
exclude_from_search = false;
See issue 202.
So I have to work around the fact the WP doesn't register post-types in a
sensible way.
I think the code in 0.9.4.2 handles this by checking the options and forcing
"public" to true:
// Verbosely check to see if "public" is inferred
if (isset($def['publicly_queriable']) && $def['publicly_queriable']
&& isset($def['show_ui']) && $def['show_ui']
&& isset($def['show_in_nav_menus']) && $def['show_in_nav_menus']
&& (!isset($def['exclude_from_search']) || (isset($def['exclude_from_search']) && !$def['publicly_queriable']))
)
{
$def['public'] = true;
}
Can you see if 0.9.4.2 fixes this problem?
Original comment by fireproofsocks
on 8 Oct 2011 at 5:36
OK upgraded to 0.9.1.4 no change in bug, I'm glad to give you login to my dev
site if you wish I just need secure method to send the info. Just as a fyi i
did test on my live production site with the same result.
Original comment by pswsa...@gmail.com
on 11 Oct 2011 at 3:15
Ok, in the 0.9.4.3-dev version (available @ http://wpcctm.com/ in about an
hour), I reworked the "public" argument to the register_post_type() function --
I basically had to cater to a WP bug. You should be able to download and
install this latest patch, then try editing and re-saving your custom post-type
definitions, and see if Role Scoper is happier.
If you need to send login details, you can contact me @
http://fireproofsocks.com/contact/
Original comment by fireproofsocks
on 12 Oct 2011 at 8:44
Ok, the newest version of the 0.9.4.3-dev patch does work with Role Scoper:
http://wpcctm.com/
Original comment by fireproofsocks
on 12 Oct 2011 at 8:45
I installed [0.9.4.3-dev] and Role Scoper does now register the content type as
long as the public attribute verbosely setting is checked.
There is still one issue, Role Scoper is keeping the Custom Content Types
options from showing in the admin menus. If Role Scoper is deactivated the
option displays.
Original comment by pswsa...@gmail.com
on 12 Oct 2011 at 10:50
Attachments:
Hmm... it seems that Role Scoper isn't enforcing permissions correctly -- the
main menu item isn't there, but if you click on Plugins --> CCTM --> Settings,
the page is still accessible. So Role Scoper is only affecting the visibility
of the page. Weirdness.
When activating the Role Scoper plugin I get this error:
"The following Custom Post Types are enabled for RS filtering: Chapter.
Non-administrators will be unable to edit them until you either disable
filtering (Roles > Options > Realm > Post Type Usage) or assign type-specific
Roles (Roles > General). Disregard this message if you have already done so."
And I've found several posts re Role Scoper where it made menu items disappear:
*
http://wordpress.org/support/topic/plugin-role-scoper-menus-under-appearance-gon
e?replies=1
*
http://wordpress.org/support/topic/role-scoper-plugin-crashes-navigation-menu?re
plies=4
*
http://wordpress.org/support/topic/plugin-role-scoper-users-menu-tab-disappears?
replies=2
Ok, interesting: I found what's causing this. It's another place where WP's
architecture is weak: when using the add_menu_page() function
(http://codex.wordpress.org/Function_Reference/add_menu_page) if 2 menu items
use the same $position attribute, only one of the items shows up in the menu;
one menu item gets overwritten. I've updated the docs.
So, I've found 2 ways of working around this:
1. Add the following to your wp-config.php file:
define( 'SCOPER_DISABLE_MENU_TWEAK', true );
2. OR... change the $position attribute used by CCTM when it creates its menu.
Inside includes/CCTM.php, search for the add_menu_page() function (around line
793). In the first item (the one for the main menu item), change the position
from 71 to 73 (Role Scoper seems to be using 71 and 72).
Since WP seems vulnerable to collisions here, I think I'll put the menu
position as a variable at the top of the CCTM class for easier editing.
Hope that takes care of it!
Original comment by fireproofsocks
on 13 Oct 2011 at 3:38
I edited the class worked like a charm - thanks. Maybe an option to change in
the setting menu might be nice for those with issues in the future, just a
thought.
Original comment by pswsa...@gmail.com
on 15 Oct 2011 at 3:14
Glad it worked. Yeah, I thought about doing a setting for the menu position,
but you'd never be able to change it via the GUI if it was encountering a
problem, so instead I put it as a class variable (i.e. a "setting for
developers") inside the CCTM class. Oh well.
Original comment by fireproofsocks
on 15 Oct 2011 at 4:30
Original issue reported on code.google.com by
pswsa...@gmail.com
on 7 Oct 2011 at 11:20