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
f6172fca
Commit
f6172fca
authored
Apr 10, 2017
by
Carsten Rose
Browse files
#3546 / lean: Internal Server Error
Throw of a UserFormException with wrong parameter. Fixed.
parent
9c795bb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/BuildFormBootstrap.php
View file @
f6172fca
...
...
@@ -148,34 +148,41 @@ class BuildFormBootstrap extends AbstractBuildForm {
*/
private
function
buildViewForm
()
{
$form
=
false
;
$url
=
''
;
$status
=
''
;
switch
(
$this
->
formSpec
[
F_NAME
])
{
case
'form'
:
$form
=
$this
->
store
->
getVar
(
F_NAME
,
STORE_RECORD
);
break
;
case
'formElement'
:
$row
=
$this
->
db
->
sql
(
"SELECT f.name FROM Form AS f WHERE id="
.
$this
->
store
->
getVar
(
FE_FORM_ID
,
STORE_RECORD
),
ROW_EXPECT_1
);
$form
=
current
(
$row
);
if
(
false
!==
(
$formId
=
$this
->
store
->
getVar
(
FE_FORM_ID
,
STORE_SIP
.
STORE_RECORD
)))
{
$row
=
$this
->
db
->
sql
(
"SELECT f.name FROM Form AS f WHERE id="
.
$formId
,
ROW_EXPECT_1
);
$form
=
current
(
$row
);
}
break
;
default
:
return
''
;
}
if
(
$form
===
false
)
{
return
''
;
$toolTip
=
"Form not 'form' or 'formElement'"
;
$status
=
'disabled'
;
}
else
{
$queryStringArray
=
[
'id'
=>
$this
->
store
->
getVar
(
SYSTEM_EDIT_FORM_PAGE
,
STORE_SYSTEM
),
'form'
=>
$form
,
'r'
=>
0
];
$queryString
=
Support
::
arrayToQueryString
(
$queryStringArray
);
$sip
=
$this
->
store
->
getSipInstance
();
$url
=
$sip
->
queryStringToSip
(
$queryString
);
$toolTip
=
"View current form with r=0"
.
PHP_EOL
.
PHP_EOL
.
OnArray
::
toString
(
$queryStringArray
,
' = '
,
PHP_EOL
,
"'"
);
}
$queryStringArray
=
[
'id'
=>
$this
->
store
->
getVar
(
SYSTEM_EDIT_FORM_PAGE
,
STORE_SYSTEM
),
'form'
=>
$form
,
'r'
=>
0
];
$queryString
=
Support
::
arrayToQueryString
(
$queryStringArray
);
$sip
=
$this
->
store
->
getSipInstance
();
$url
=
$sip
->
queryStringToSip
(
$queryString
);
$toolTip
=
"View current form with r=0"
.
PHP_EOL
.
PHP_EOL
.
OnArray
::
toString
(
$queryStringArray
,
' = '
,
PHP_EOL
,
"'"
);
return
$this
->
buildButtonAnchor
(
'form-view-'
.
$this
->
formSpec
[
F_ID
],
$url
,
$toolTip
,
GLYPH_ICON_VIEW
,
''
);
return
$this
->
buildButtonAnchor
(
'form-view-'
.
$this
->
formSpec
[
F_ID
],
$url
,
$toolTip
,
GLYPH_ICON_VIEW
,
$status
);
}
...
...
extension/qfq/qfq/form/FormAction.php
View file @
f6172fca
...
...
@@ -14,6 +14,7 @@ require_once(__DIR__ . '/../store/Store.php');
require_once
(
__DIR__
.
'/../Evaluate.php'
);
require_once
(
__DIR__
.
'/../report/Sendmail.php'
);
require_once
(
__DIR__
.
'/../helper/HelperFormElement.php'
);
require_once
(
__DIR__
.
'/../exceptions/UserFormException.php'
);
/**
* Class formAction
...
...
@@ -100,7 +101,7 @@ class FormAction {
}
}
else
{
// At the moment 'action' elements have to point to a templateGroup - nothing else is defined. Break if there is something else
throw
new
UserFormException
(
"Expect a 'templateGroup' record in FormElement.id="
,
$fe
[
FE_ID_CONTAINER
],
ERROR_RECORD_NOT_FOUND
);
throw
new
UserFormException
(
"Expect a 'templateGroup' record in FormElement.id="
.
$fe
[
FE_ID_CONTAINER
],
ERROR_RECORD_NOT_FOUND
);
}
continue
;
// skip to next FormElement
}
...
...
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