Jump to content

[BUG 4.7.16] Exception thrown when editing a member's restrictions in ACP with Downloads application


Recommended Posts

Posted (edited)

This exception is thrown when editing a member's Warnings & Restrictions from an ACP profile:

Whoops\Exception\ErrorException thrown with message "Undefined array key "idm_block_submissions""

Stacktrace:
#7 Whoops\Exception\ErrorException in \system\Patterns\Bitwise.php:112
#6 Whoops\Run:handleError in \system\Patterns\Bitwise.php:112
#5 IPS\Patterns\_Bitwise:offsetGet in \applications\downloads\extensions\core\MemberRestrictions\Downloads.php:48
#4 IPS\downloads\extensions\core\MemberRestrictions\_Downloads:save in \applications\core\extensions\core\MemberACPProfileBlocks\Warnings.php:130
#3 IPS\core\extensions\core\MemberACPProfileBlocks\_Warnings:edit in \applications\core\modules\admin\members\members.php:1307
#2 IPS\core\modules\admin\members\_members:editBlock in \system\Dispatcher\Controller.php:107
#1 IPS\Dispatcher\_Controller:execute in \system\Dispatcher\Dispatcher.php:153
#0 IPS\_Dispatcher:run in \init.php:934

 

The issue is caused by the save function's code in /applications/downloads/extensions/core/MemberRestrictions/Downloads.php (line 48):

	public function save( $values )
	{
		$return = array();
		
		if ( $this->member->idm_block_submissions == $values['idm_block_submissions'] )
		{
			$return['idm_block_submissions'] = array( 'old' => $this->member->members_bitoptions['idm_block_submissions'], 'new' => !$values['idm_block_submissions'] );
			$this->member->idm_block_submissions = !$values['idm_block_submissions'];
		}
		
		return $return;
	}

 

The value for the old array key is using the wrong "bitoptions" syntax:

$this->member->members_bitoptions['idm_block_submissions']

when it should be:

$this->member->idm_block_submissions
Edited by teraßyte
Link to comment
Share on other sites

Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release.

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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