The wrong data source was used in `AclFormField` (the whole `$_POST` array instead of the dedicated entry) and the data was always stored in `aclValues` instead of a dedicated entry per form field.
{include file='aclPermissions'}
{/if}
-{include file='aclPermissionJavaScript' containerID=$field->getPrefixedId()|concat:'Container' categoryName=$field->getCategoryName() objectID=$field->getObjectID() objectTypeID=$field->getObjectType()->objectTypeID aclFormBuilderMode=true}
+{include file='aclPermissionJavaScript' containerID=$field->getPrefixedId()|concat:'Container' categoryName=$field->getCategoryName() objectID=$field->getObjectID() objectTypeID=$field->getObjectType()->objectTypeID aclFormBuilderMode=true aclValuesFieldName=$field->getPrefixedId()}
{/if}
{/if}
- var aclList = new {if $aclListClassName|isset}{@$aclListClassName}{else}WCF.ACL.List{/if}($('#{@$containerID}'), {@$objectTypeID}, {if $categoryName|isset}'{@$categoryName}'{else}null{/if}, {if $objectID|isset}{@$objectID}{else}0{/if}, {if !$includeUserGroups|isset || $includeUserGroups}true{else}false{/if}{if $aclValues[$objectTypeID]|isset}, initialPermissions{/if});
+ var aclList = new {if $aclListClassName|isset}{@$aclListClassName}{else}WCF.ACL.List{/if}(
+ $('#{@$containerID}'),
+ {@$objectTypeID},
+ {if $categoryName|isset}'{@$categoryName}'{else}null{/if},
+ {if $objectID|isset}{@$objectID}{else}0{/if},
+ {if !$includeUserGroups|isset || $includeUserGroups}true{else}false{/if},
+ {if $aclValues[$objectTypeID]|isset}initialPermissions{else}undefined{/if},
+ {if $aclValuesFieldName|isset}'{@$aclValuesFieldName}'{else}undefined{/if}
+ );
{if !$aclFormBuilderMode|empty}
require(['WoltLabSuite/Core/Form/Builder/Manager'], function(FormBuilderManager) {
{include file='aclPermissions'}
{/if}
-{include file='aclPermissionJavaScript' containerID=$field->getPrefixedId()|concat:'Container' categoryName=$field->getCategoryName() objectID=$field->getObjectID() objectTypeID=$field->getObjectType()->objectTypeID aclFormBuilderMode=true}
+{include file='aclPermissionJavaScript' containerID=$field->getPrefixedId()|concat:'Container' categoryName=$field->getCategoryName() objectID=$field->getObjectID() objectTypeID=$field->getObjectType()->objectTypeID aclFormBuilderMode=true aclValuesFieldName=$field->getPrefixedId()}
{/if}
{/if}
- var aclList = new {if $aclListClassName|isset}{@$aclListClassName}{else}WCF.ACL.List{/if}($('#{@$containerID}'), {@$objectTypeID}, {if $categoryName|isset}'{@$categoryName}'{else}null{/if}, {if $objectID|isset}{@$objectID}{else}0{/if}, {if !$includeUserGroups|isset || $includeUserGroups}true{else}false{/if}{if $aclValues[$objectTypeID]|isset}, initialPermissions{/if});
+ var aclList = new {if $aclListClassName|isset}{@$aclListClassName}{else}WCF.ACL.List{/if}(
+ $('#{@$containerID}'),
+ {@$objectTypeID},
+ {if $categoryName|isset}'{@$categoryName}'{else}null{/if},
+ {if $objectID|isset}{@$objectID}{else}0{/if},
+ {if !$includeUserGroups|isset || $includeUserGroups}true{else}false{/if},
+ {if $aclValues[$objectTypeID]|isset}initialPermissions{else}undefined{/if},
+ {if $aclValuesFieldName|isset}'{@$aclValuesFieldName}'{else}undefined{/if}
+ );
{if !$aclFormBuilderMode|empty}
require(['WoltLabSuite/Core/Form/Builder/Manager'], function(FormBuilderManager) {
* @param string categoryName
* @param integer objectID
* @param boolean includeUserGroups
+ * @param string|undefined aclValuesFieldName
*/
- init: function (containerSelector, objectTypeID, categoryName, objectID, includeUserGroups, initialPermissions) {
+ init: function (containerSelector, objectTypeID, categoryName, objectID, includeUserGroups, initialPermissions, aclValuesFieldName) {
this._objectID = objectID || 0;
this._objectTypeID = objectTypeID;
this._categoryName = categoryName;
group: {},
user: {}
};
+ this._aclValuesFieldName = aclValuesFieldName || 'aclValues';
this._proxy = new WCF.Action.Proxy({
showLoadingOverlay: false,
var $object = this._values[$type][$objectID];
for (var $optionID in $object) {
- $('<input type="hidden" name="aclValues[' + $type + '][' + $objectID + '][' + $optionID + ']" value="' + $object[$optionID] + '" />').appendTo($form);
+ $('<input type="hidden" name="' + this._aclValuesFieldName + '[' + $type + '][' + $objectID + '][' + $optionID + ']" value="' + $object[$optionID] + '" />').appendTo($form);
}
}
}
* @inheritDoc
*/
public function readValue() {
- $valueSource = $_POST;
+ $valueSource = $_POST[$this->getPrefixedId()] ?? [];
if ($this->getDocument()->isAjax()) {
$valueSource = [];
if (