Jump to content

Permise edit item without a category


BomAle

Recommended Posts

I am asking for future release to permise developers to have option to edit item without any category (0) because a default system not avoid to delete all category... if admin delete all category and try to edit items it will get 2S136/E error

I don't know if there is some reason that IPS developers must fix before integrate this, but it could be useful for members that would use tags instead categories, behaviour for restricted content could be related only for admin moderator but members and guest could have same permissions.

Quote

 

(--- category for admin

--- category for members ) this is a block it could be moved on sidebar

(block list with all available tags go here)

TABLE -> list of items without category permissions, filter by tags (multiple allowed)

 

@bfarber @Lindy @Mark @Matt

some guide talk about: "In most cases"

Quote

'#0 [internal function]: IPS\\Patterns\\_ActiveRecord::load(0)
#1 D:\\Programmi\\Ampps\\www\\ips4\\system\\Content\\Item.php(1028): call_user_func(Array, 0)
#2 D:\\Programmi\\Ampps\\www\\ips4\\system\\Content\\Item.php(998): IPS\\Content\\_Item->container()
#3 D:\\Programmi\\Ampps\\www\\ips4\\system\\Content\\Item.php(5182): IPS\\Content\\_Item->containerWrapper()
#4 D:\\Programmi\\Ampps\\www\\ips4\\system\\Content\\Controller.php(374): IPS\\Content\\_Item->canEdit()
#5 D:\\Programmi\\Ampps\\www\\ips4\\system\\Dispatcher\\Controller.php(85): IPS\\Content\\_Controller->edit()
#6 D:\\Programmi\\Ampps\\www\\ips4\\system\\Content\\Controller.php(50): IPS\\Dispatcher\\_Controller->execute()
#7 D:\\Programmi\\Ampps\\www\\ips4\\applications\\advpolls\\modules\\front\\advpolls\\poll.php(31): IPS\\Content\\_Controller->execute()
#8 D:\\Programmi\\Ampps\\www\\ips4\\system\\Dispatcher\\Dispatcher.php(146): IPS\\advpolls\\modules\\front\\advpolls\\_poll->execute()
#9 D:\\Programmi\\Ampps\\www\\ips4\\index.php(12): IPS\\_Dispatcher->run()
#10 {main}'

into the \IPS\Content\Item::canEdit  we have

/* Do we have moderator permission to edit stuff in the container? */
if ( static::modPermission( 'edit', $member, $this->containerWrapper() ) )
{
	return TRUE;
}

-------
if $this->containerWrapper() assign the first param to true it will not trow exception $this->containerWrapper( true )
-------

 

Link to comment
Share on other sites

Yes, I have forced to avoid deleting all categories and on install the source create first category. I have adopt in-built theOnlyNode added fourth param for set specific permission (not only view, like read and add...). When go to add/create item form, the code autoload the category if there are not any others.

site/defaultmodule/add/ if not request id check for theOnlyNode(.., .., .., 'add') if only load item( $theOnlyNode ) else create( NULL ) this will add into form the form/node to select a category as required.

This way I can offer ability to categorize and tagging. I can go forward :thumbsup:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...