-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Add argument "fields" to editRecord ViewHelpers
The <be:link.editRecord> and <be:url.editRecord> now have an option argument "fields" which can be used to limit the edit form to only these fields (instead of the entire record). The fields should be passed in a comma separated list. Resolves: #89644 Releases: master Change-Id: I28913c072578aacd1da95c3bacebea35f8958bac Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62298 Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Oliver Bartsch <bo@cedev.de> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Oliver Bartsch <bo@cedev.de> Reviewed-by: Daniel Siepmann <coding@daniel-siepmann.de> Reviewed-by: Benni Mack <benni@typo3.org>
- Loading branch information
Showing
9 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...Tests/Functional/ViewHelpers/Fixtures/Link/EditRecordViewHelper/WithUidTableAndField.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<html xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"> | ||
<be:link.editRecord uid="43" table="c_table" fields="canonical_url">edit record c_table:42</be:link.editRecord> | ||
</html> |
3 changes: 3 additions & 0 deletions
3
...ests/Functional/ViewHelpers/Fixtures/Link/EditRecordViewHelper/WithUidTableAndFields.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<html xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"> | ||
<be:link.editRecord uid="43" table="c_table" fields="canonical_url,title">edit record c_table:42</be:link.editRecord> | ||
</html> |
3 changes: 3 additions & 0 deletions
3
.../Tests/Functional/ViewHelpers/Fixtures/Uri/EditRecordViewHelper/WithUidTableAndField.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<html xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"> | ||
<be:uri.editRecord uid="43" table="c_table" fields="canonical_url">edit record c_table:43</be:uri.editRecord> | ||
</html> |
3 changes: 3 additions & 0 deletions
3
...Tests/Functional/ViewHelpers/Fixtures/Uri/EditRecordViewHelper/WithUidTableAndFields.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<html xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"> | ||
<be:uri.editRecord uid="43" table="c_table" fields="canonical_url,title">edit record c_table:43</be:uri.editRecord> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...gelog/master/Feature-89644-AddOptionalArgumentFieldsToEditRecordViewHelpers.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.. include:: ../../Includes.txt | ||
|
||
========================================================================== | ||
Feature: #89644 - Add optional argument "fields" to editRecord ViewHelpers | ||
========================================================================== | ||
|
||
See :issue:`89644` | ||
|
||
Description | ||
=========== | ||
|
||
An optional argument "fields" is added to the uri.editRecord and link.editRecord ViewHelper. | ||
This can contain the names of one or more database fields (comma separated). | ||
|
||
If the argument "fields" is set, FormEngine creates a form to edit only these fields. | ||
|
||
|
||
Impact | ||
====== | ||
|
||
This ViewHelper passes the value given in the `fields` argument to the backend route | ||
'/record/edit` as `columnsOnly` argument. | ||
|
||
The functionality for `columnsOnly` already existed for the backend route | ||
`/record/edit` before this patch. | ||
|
||
Example | ||
======= | ||
|
||
Create a link to edit the `tt_content.bodytext` field of record with uid 42: | ||
|
||
.. code-block:: xml | ||
<be:link.editRecord uid="42" table="tt_content" fields="bodytext" returnUrl="foo/bar"> | ||
Edit record | ||
</be:link.editRecord> | ||
Output: | ||
|
||
.. code-block:: html | ||
|
||
|
||
<a href="/typo3/index.php?route=/record/edit&edit[tt_content][42]=edit&returnUrl=foo/bar&columnsOnly=bodytext"> | ||
Edit record | ||
</a> | ||
|
||
|
||
|
||
.. index:: Fluid, ext:backend |