Bug #82051

Error in EXT:form documentation regarding deletion of YAML configuration

Added by Peter Kraume 12 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Should have
Category:
Form Framework
Target version:
Start date:
2017-08-05
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

There is an error in the EXT:form documentation:
https://docs.typo3.org/typo3cms/drafts/code.tritum.de/TYPO3.CMS/Form_Documentation/Concepts/Configuration/Index.html?highlight=null#inheritances

Finally, all configuration entries with a value of `null` are deleted.

It’s not `null` but `__UNSET`.

This is done in `TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule()` line 613:
https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_8-7/typo3/sysext/core/Classes/Utility/ArrayUtility.php#L613

Associated revisions

Revision 77899870 (diff)
Added by Ralf Zimmermann 6 months ago

[BUGFIX] EXT:form - fix array overrules within YAML preprocessing

If you use the "__inheritance" operator within an EXT:form configuration
file, configuration keys of the parent element can be deleted in the
child element by giving the configuration key in the child element
the value NULL.
See https://docs.typo3.org/typo3cms/extensions/form/latest/Concepts/
Configuration/Index.html#inheritances for further information.

Before the "__inheritance" operators are executed, all configuration
files are merged using
TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule().

However, this does not work if you are using several configuration files.

Let's assume the configuration key in the previous configuration file is
an array. mergeRecursiveWithOverrule() does not delete this
configuration key, if the configuration key in the overriding
configuration file is not an array (for example: NULL). This is simply
ignored by mergeRecursiveWithOverrule().

This patch fixes this issue by adding a variation of
array_merge_recursive().

Resolves: #82051
Releases: master, 8.7
Change-Id: Id9d256226a3eb82f6bc3fd03904f944719e525e7
Reviewed-on: https://review.typo3.org/55487
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>
Reviewed-by: Tobi Kretschmann <>
Tested-by: TYPO3com <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Reviewed-by: Frank Naegler <>
Tested-by: Frank Naegler <>
Reviewed-by: Peter Kraume <>
Tested-by: Peter Kraume <>
Reviewed-by: Oliver Hader <>
Tested-by: Oliver Hader <>

Revision a509d71b (diff)
Added by Ralf Zimmermann 6 months ago

[BUGFIX] EXT:form - fix array overrules within YAML preprocessing

If you use the "__inheritance" operator within an EXT:form configuration
file, configuration keys of the parent element can be deleted in the
child element by giving the configuration key in the child element
the value NULL.
See https://docs.typo3.org/typo3cms/extensions/form/latest/Concepts/
Configuration/Index.html#inheritances for further information.

Before the "__inheritance" operators are executed, all configuration
files are merged using
TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule().

However, this does not work if you are using several configuration files.

Let's assume the configuration key in the previous configuration file is
an array. mergeRecursiveWithOverrule() does not delete this
configuration key, if the configuration key in the overriding
configuration file is not an array (for example: NULL). This is simply
ignored by mergeRecursiveWithOverrule().

This patch fixes this issue by adding a variation of
array_merge_recursive().

Resolves: #82051
Releases: master, 8.7
Change-Id: Id9d256226a3eb82f6bc3fd03904f944719e525e7
Reviewed-on: https://review.typo3.org/55565
Tested-by: TYPO3com <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Reviewed-by: Peter Kraume <>
Tested-by: Peter Kraume <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Gerrit Code Review 12 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53647

#2 Updated by Bjoern Jacob 11 months ago

  • Sprint Focus set to Remote Sprint

#3 Updated by Ralf Zimmermann 11 months ago

  • Assignee set to Ralf Zimmermann

#4 Updated by Peter Kraume 10 months ago

So there was the EXT:form code sprint last week. Any progress on this issue? I assumed it to be a nobrainer!

#5 Updated by Ralf Zimmermann 10 months ago

Its more than change the documentation. We have to work on the code because there are some cases on which only "_UNSET" works but this is not the intended behavior. I am working on this and i will provide a patchset within the next days.

#6 Updated by Peter Kraume 9 months ago

Any news on this issue? Maybe it makes sense to merge the patch to 8.7 branch only?

#7 Updated by Bjoern Jacob 8 months ago

  • Related to Feature #82089: EXT:form Support "imports" in form configuration added

#8 Updated by Bjoern Jacob 8 months ago

For v9 we are improving the situation with #82089.

It is very difficult to solve for v8. For this version, we would need a proper documentation. But the problem is hard to tackle/ describe. It depends on the stuff you are doing -> different situation -> different solution.

#9 Updated by Ralf Zimmermann 6 months ago

  • Status changed from Under Review to Needs Feedback
  • Assignee changed from Ralf Zimmermann to Peter Kraume

Hi Peter,

can you please tell me an example configuration where the error can be reproduced?

#10 Updated by Ralf Zimmermann 6 months ago

  • Status changed from Needs Feedback to In Progress
  • Assignee changed from Peter Kraume to Ralf Zimmermann

I found it myself again ;) Thank you anyway.

#11 Updated by Peter Kraume 6 months ago

Thx for taking care!

#12 Updated by Gerrit Code Review 6 months ago

  • Status changed from In Progress to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55487

#13 Updated by Gerrit Code Review 6 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55487

#14 Updated by Gerrit Code Review 6 months ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55487

#15 Updated by Susanne Moog 6 months ago

  • Target version set to 8.7.10

#16 Updated by Gerrit Code Review 6 months ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55487

#17 Updated by Gerrit Code Review 6 months ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55487

#18 Updated by Gerrit Code Review 6 months ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55487

#19 Updated by Gerrit Code Review 6 months ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55565

#20 Updated by Ralf Zimmermann 6 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#21 Updated by Oliver Hader 6 months ago

  • Status changed from Resolved to Under Review

#22 Updated by Ralf Zimmermann 6 months ago

  • Status changed from Under Review to Resolved

#23 Updated by Bjoern Jacob 5 months ago

  • Sprint Focus deleted (Remote Sprint)

#24 Updated by Ralf Zimmermann 4 months ago

  • Related to deleted (Feature #82089: EXT:form Support "imports" in form configuration)

Also available in: Atom PDF