Open cb2004 opened 3 years ago
There is also an error on line 211 once commenting out line 205
Fatal Error: Uncaught Error: Attempt to assign property "notes" on null in site/modules/FieldtypeSecureFile/FieldtypeSecureFile.module:211
If you move that section into a newly-created ___getConfigAdvancedInputfields
function, it seems to resolve this error. Perhaps the inputfieldClass was moved to the 'advanced' function at some point?
public function ___getConfigInputfields(Field $field)
{
$inputfields = parent::___getConfigInputfields($field);
// rest of function, $fStorage = ...
}
/**
* Field advanced config
*
*/
public function ___getConfigAdvancedInputfields(Field $field)
{
$inputfields = parent::___getConfigAdvancedInputfields($field);
// Only allow InputfieldFile as Inputfield
$fInputfield = $inputfields->get('inputfieldClass');
$options = $fInputfield->getOptions();
foreach ($options as $option => $title) {
if (!in_array($option, static::$allowedInputFields)) {
$fInputfield->removeOption($option);
}
}
$fInputfield->notes = $this->_('Currently, InputfieldFile is the only supported Inputfield for secure files');
return $inputfields;
}
That is a confirmed fix, although I wont close the issue until @wanze takes a look.
Thanks @cb2004 and @craigrodway I am a bit disconnected from ProcessWire at the moment, would it be possible to send a pull request? 😊 Not sure how we should implement this without breaking the module for older versions of ProcessWire though.
Cheers
Not sure when this issue crept in, I am guessing when the file/image fields were refactored:
Fatal Error: Uncaught Error: Call to a member function getOptions() on null in site/modules/FieldtypeSecureFile/FieldtypeSecureFile.module:205