Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
ab1f166a
Commit
ab1f166a
authored
Jan 09, 2020
by
Carsten Rose
Browse files
Fixes #9858. Feature Form.parameter: replace 'mode' by 'formModeGlobal'
parent
6c1e1d49
Pipeline
#3115
passed with stages
in 2 minutes
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
extension/Classes/Core/AbstractBuildForm.php
View file @
ab1f166a
...
...
@@ -2302,8 +2302,8 @@ abstract class AbstractBuildForm {
];
// Inherit current F_MODE
if
(
$this
->
formSpec
[
F_MODE
]
!=
''
)
{
$queryStringArray
[
F_MODE_GLOBAL
]
=
$this
->
formSpec
[
F_MODE
];
if
(
$this
->
formSpec
[
F_MODE
_GLOBAL
]
!=
''
)
{
$queryStringArray
[
F_MODE_GLOBAL
]
=
$this
->
formSpec
[
F_MODE
_GLOBAL
];
}
// In case the subrecord FE is set to 'readonly': subforms will be called with formModeGlobal=readonly
...
...
extension/Classes/Core/BuildFormBootstrap.php
View file @
ab1f166a
...
...
@@ -586,6 +586,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
* @throws \CodeException
* @throws \DbException
* @throws \UserFormException
* @throws \UserReportException
*/
public
function
getFormTag
()
{
...
...
extension/Classes/Core/Constants.php
View file @
ab1f166a
...
...
@@ -1010,7 +1010,6 @@ const F_TYPEAHEAD_LDAP_SEARCH = 'typeAheadLdapSearch';
const
F_TYPEAHEAD_LDAP_SEARCH_PREFETCH
=
'typeAheadLdapSearchPrefetch'
;
const
F_TYPEAHEAD_LDAP_SEARCH_PER_TOKEN
=
'typeAheadLdapSearchPerToken'
;
const
F_MODE
=
'mode'
;
const
F_MODE_READONLY
=
'readonly'
;
const
F_MODE_REQUIRED_OFF
=
'requiredOff'
;
const
F_MODE_REQUIRED_OFF_BUT_MARK
=
'requiredOffButMark'
;
...
...
extension/Classes/Core/Helper/Support.php
View file @
ab1f166a
...
...
@@ -855,8 +855,8 @@ class Support {
$formElement
[
FE_MODE
]
=
$formElement
[
FE_MODE_SQL
];
}
if
(
isset
(
$formSpec
[
F_MODE
]))
{
$formElement
[
FE_MODE
]
=
self
::
applyFormModeToFormElement
(
$formElement
[
FE_MODE
],
$formSpec
[
F_MODE
]);
if
(
isset
(
$formSpec
[
F_MODE
_GLOBAL
]))
{
$formElement
[
FE_MODE
]
=
self
::
applyFormModeToFormElement
(
$formElement
[
FE_MODE
],
$formSpec
[
F_MODE
_GLOBAL
]);
}
// set typeAheadPedantic
...
...
extension/Classes/Core/QuickFormQuery.php
View file @
ab1f166a
...
...
@@ -448,7 +448,7 @@ class QuickFormQuery {
$recordDirty
=
array
();
$rcLockFound
=
$dirty
->
getCheckDirty
(
$this
->
formSpec
[
F_TABLE_NAME
],
$recordId
,
$recordDirty
,
$msg
);
if
((
$rcLockFound
==
LOCK_FOUND_CONFLICT
||
$rcLockFound
==
LOCK_FOUND_OWNER
)
&&
$recordDirty
[
F_DIRTY_MODE
]
==
DIRTY_MODE_EXCLUSIVE
)
{
$this
->
formSpec
[
F_MODE
]
=
F_MODE_READONLY
;
$this
->
formSpec
[
F_MODE
_GLOBAL
]
=
F_MODE_READONLY
;
}
}
...
...
@@ -1435,7 +1435,6 @@ class QuickFormQuery {
Support
::
setIfNotSet
(
$formSpec
,
F_SUBMIT_BUTTON_TEXT
,
''
);
Support
::
setIfNotSet
(
$formSpec
,
F_BUTTON_ON_CHANGE_CLASS
,
''
);
Support
::
setIfNotSet
(
$formSpec
,
F_LDAP_USE_BIND_CREDENTIALS
,
''
);
Support
::
setIfNotSet
(
$formSpec
,
F_MODE
,
''
);
Support
::
setIfNotSet
(
$formSpec
,
F_DB_INDEX
,
$this
->
store
->
getVar
(
F_DB_INDEX
,
STORE_SYSTEM
));
Support
::
setIfNotSet
(
$formSpec
,
F_ENTER_AS_SUBMIT
,
$this
->
store
->
getVar
(
SYSTEM_ENTER_AS_SUBMIT
,
STORE_SYSTEM
));
Support
::
setIfNotSet
(
$formSpec
,
F_SESSION_TIMEOUT_SECONDS
,
$this
->
store
->
getVar
(
SYSTEM_SESSION_TIMEOUT_SECONDS
,
STORE_SYSTEM
));
...
...
@@ -1453,10 +1452,18 @@ class QuickFormQuery {
// }
// }
//
$formSpec
[
F_MODE
]
=
Support
::
getFormModeGlobal
(
$formSpec
[
F_MODE
]);
// Check for deprecated legacy code
if
(
isset
(
$formSpec
[
'mode'
]))
{
throw
new
\
UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
'Outdated form definition'
,
ERROR_MESSAGE_TO_DEVELOPER
=>
"form.parameter.mode is deprecated. Please use form.parameter.formModeGlobal instead."
]));
}
// Unify F_MODE_GLOBAL
$formSpec
[
F_MODE_GLOBAL
]
=
Support
::
getFormModeGlobal
(
$formSpec
[
F_MODE_GLOBAL
]
??
''
);
if
(
$formSpec
[
F_MODE
]
==
F_MODE_READONLY
)
{
if
(
$formSpec
[
F_MODE
_GLOBAL
]
==
F_MODE_READONLY
)
{
$formSpec
[
F_SHOW_BUTTON
]
=
FORM_BUTTON_CLOSE
;
$formSpec
[
F_SUBMIT_BUTTON_TEXT
]
=
''
;
}
...
...
extension/Classes/Core/Store/FillStoreForm.php
View file @
ab1f166a
...
...
@@ -235,7 +235,7 @@ class FillStoreForm {
$clientFieldName
=
(
$formMode
==
FORM_REST
)
?
$formElement
[
FE_NAME
]
:
HelperFormElement
::
buildFormElementName
(
$formElement
,
$fakeRecordId
);
// Some Defaults
$formElement
=
Support
::
setFeDefaults
(
$formElement
,
[
F_MODE
=>
$formModeGlobal
]);
$formElement
=
Support
::
setFeDefaults
(
$formElement
,
[
F
E
_MODE
=>
$formModeGlobal
]);
if
(
$formElement
[
FE_TYPE
]
===
FE_TYPE_EXTRA
)
{
// Extra elements will be transferred by SIP
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment