I need to update the limit setting for Images allowed to be empty, so as to allow for no limit. How do I go about updating the 'limit' setting?
$fieldsService = Craft::$app->getFields(); $field = $fieldsService->getFieldByHandle('productImages'); // Need to update 'limit' to equal '' (currently limited to '5') // Then save the new setting $fieldsService->saveField($field);
I was able to accomplish this by using
setAttributes and setting the second argument
$field->setAttributes([ 'limit' => '' ],false);