Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted September 5, 20177 yr this is a new one for me, SELECT * FROM `pro_babble_rooms` AS `babble_rooms` LEFT JOIN `pro_core_permission_index` AS `core_permission_index` ON core_permission_index.app='babble' AND core_permission_index.perm_type='rooms' AND core_permission_index.perm_type_id=babble_rooms.rooms_id WHERE (( FIND_IN_SET(2,perm_) ) OR perm_='*' ) Unknown column 'perm_' in 'where clause' this is cause by line 201 in /applications/core/extensions/core/sitemap/Content.php: $select = new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', $nodeClass::$databaseTable, array( '(' . \IPS\Db::i()->findInSet( "perm_{$nodeClass::$permissionMap['read']}", array( \IPS\Settings::i()->guest_group ) ) . ' OR ' . "perm_{$nodeClass::$permissionMap['read']}=? )", '*' ) )->join( 'core_permission_index', array( "core_permission_index.app=? AND core_permission_index.perm_type=? AND core_permission_index.perm_type_id={$nodeClass::$databaseTable}.{$nodeClass::$databasePrefix}{$nodeClass::$databaseColumnId}", $nodeClass::$permApp, $nodeClass::$permType ) ), $nodeClass ); i wasn't aware "read" was required to be in the permission map. this seems to have started happening when i upgraded to 4.2.3, so i am assuming it is a undocumented change?
September 5, 20177 yr The line in question has been the same since Dec 29 2015 (I had to dig through git history to confirm). Quote Some keys are required if your models implement certain other functionality: view (can see the node) is always required (defined as the value 'view') read (can read content items) is always required add (can add content items) is always required reply (can reply to content items) is required if your content items can be commented on review (can review content items) is required if your content items support reviews Note that our documentation states 'read' is always required if you implement permissions in your nodes.
September 5, 20177 yr Author 3 hours ago, bfarber said: The line in question has been the same since Dec 29 2015 (I had to dig through git history to confirm). then what has changed? why am i suddenly since august 29 (shortly after upgrading to 4.2.3) getting these error messages?
September 5, 20177 yr Hard for me to say right now, however 'read' perm is a required permission when you implement permissions per the documentation, so I would work on getting it implemented.
September 5, 20177 yr Author 40 minutes ago, bfarber said: Hard for me to say right now, however 'read' perm is a required permission when you implement permissions per the documentation, so I would work on getting it implemented. i have, was just more curious after like a year and a half now, it just started doing this.
October 17, 20177 yr I've the same problem with Awards app. In my case I've: /** * @var array */ public static $permissionMap = array( 'view' => 'view', 'add' => 2, 'receive' => 3, 'self' => 4, 'restrict' => 5, 'manage' => 6, 'awarded' => 7 ); It's enough add read in this way? /** * @var array */ public static $permissionMap = array( 'view' => 'view', 'add' => 2, 'receive' => 3, 'self' => 4, 'restrict' => 5, 'manage' => 6, 'awarded' => 7, 'read' => 8 );
October 17, 20177 yr 24 minutes ago, InvisionHQ said: I've the same problem with Awards app. In my case I've: /** * @var array */ public static $permissionMap = array( 'view' => 'view', 'add' => 2, 'receive' => 3, 'self' => 4, 'restrict' => 5, 'manage' => 6, 'awarded' => 7 ); It's enough add read in this way? /** * @var array */ public static $permissionMap = array( 'view' => 'view', 'add' => 2, 'receive' => 3, 'self' => 4, 'restrict' => 5, 'manage' => 6, 'awarded' => 7, 'read' => 8 ); yes
October 17, 20177 yr Thanks, If permissions exceed 7, as in my case, is it a good practice to add a column in core_permission_index? Another thing, I do not know if it can be useful but looking at the code I saw that in pages (blocks, fields) the "read" permission is missing.
October 17, 20177 yr Blocks, Fields and several other classes don't need the read permission because they don't contain a contentItemClass I would suggest to take a look at following article where everything is explained.
Archived
This topic is now archived and is closed to further replies.