Skip to content
GitLab
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
f000706b
Commit
f000706b
authored
Oct 05, 2016
by
Carsten Rose
Browse files
QuickFormQuery.php, Database.php: throw an error if table 'Form' is missing.
parent
0e1a1978
Changes
3
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/Constants.php
View file @
f000706b
...
...
@@ -146,42 +146,43 @@ const ERROR_EXPECTED_ARRAY = 1061;
const
ERROR_REPORT_FAILED_ACTION
=
1062
;
const
ERROR_MISSING_MESSAGE_FAIL
=
1063
;
const
ERROR_MISSING_TABLE_NAME
=
1064
;
const
ERROR_RECORD_NOT_FOUND
=
1065
;
const
ERROR_INVALID_EDITOR_PROPERTY_NAME
=
1066
;
const
ERROR_MISSING_TABLE
=
1065
;
const
ERROR_RECORD_NOT_FOUND
=
1066
;
const
ERROR_INVALID_EDITOR_PROPERTY_NAME
=
1067
;
// Subrecord
const
ERROR_SUBRECORD_MISSING_COLUMN_ID
=
1
066
;
const
ERROR_SUBRECORD_MISSING_COLUMN_ID
=
1
100
;
// Store
const
ERROR_STORE_VALUE_ALREADY_CODPIED
=
1
1
00
;
const
ERROR_STORE_KEY_EXIST
=
1
1
01
;
const
ERROR_STORE_VALUE_ALREADY_CODPIED
=
1
2
00
;
const
ERROR_STORE_KEY_EXIST
=
1
2
01
;
// I/O Error
const
ERROR_IO_READ_FILE
=
1
2
00
;
const
ERROR_IO_WRITE
=
1
2
03
;
const
ERROR_IO_OPEN
=
1
2
04
;
const
ERROR_IO_UNLINK
=
1
2
05
;
const
ERROR_IO_FILE_EXIST
=
1
2
06
;
const
ERROR_IO_RENAME
=
1
2
07
;
const
ERROR_IO_INVALID_LINK
=
1
2
08
;
const
ERROR_IO_DIR_EXIST_AS_FILE
=
1
2
09
;
const
ERROR_IO_CHDIR
=
1
2
10
;
const
ERROR_IO_READ_FILE
=
1
3
00
;
const
ERROR_IO_WRITE
=
1
3
03
;
const
ERROR_IO_OPEN
=
1
3
04
;
const
ERROR_IO_UNLINK
=
1
3
05
;
const
ERROR_IO_FILE_EXIST
=
1
3
06
;
const
ERROR_IO_RENAME
=
1
3
07
;
const
ERROR_IO_INVALID_LINK
=
1
3
08
;
const
ERROR_IO_DIR_EXIST_AS_FILE
=
1
3
09
;
const
ERROR_IO_CHDIR
=
1
3
10
;
//Report
const
ERROR_UNKNOWN_LINK_QUALIFIER
=
1
3
00
;
const
ERROR_UNDEFINED_RENDER_CONTROL_COMBINATION
=
1
3
01
;
const
ERROR_MISSING_VALUE
=
1
3
02
;
const
ERROR_INVALID_VALUE
=
1
3
03
;
const
ERROR_MULTIPLE_DEFINITION
=
1
3
04
;
const
ERROR_MULTIPLE_URL_PAGE_MAILTO_DEFINITION
=
1
3
05
;
const
ERROR_UNKNOWN_TOKEN
=
1
3
06
;
const
ERROR_TOO_FEW_PARAMETER_FOR_SENDMAIL
=
1
3
07
;
const
ERROR_TOO_MANY_PARAMETER
=
1
3
08
;
const
ERROR_UNKNOWN_LINK_QUALIFIER
=
1
4
00
;
const
ERROR_UNDEFINED_RENDER_CONTROL_COMBINATION
=
1
4
01
;
const
ERROR_MISSING_VALUE
=
1
4
02
;
const
ERROR_INVALID_VALUE
=
1
4
03
;
const
ERROR_MULTIPLE_DEFINITION
=
1
4
04
;
const
ERROR_MULTIPLE_URL_PAGE_MAILTO_DEFINITION
=
1
4
05
;
const
ERROR_UNKNOWN_TOKEN
=
1
4
06
;
const
ERROR_TOO_FEW_PARAMETER_FOR_SENDMAIL
=
1
4
07
;
const
ERROR_TOO_MANY_PARAMETER
=
1
4
08
;
// Upload
const
ERROR_UPLOAD
=
1
4
00
;
const
ERROR_UNKNOWN_ACTION
=
1
4
02
;
const
ERROR_NO_TARGET_PATH_FILE_NAME
=
1
4
03
;
const
ERROR_UPLOAD
=
1
5
00
;
const
ERROR_UNKNOWN_ACTION
=
1
5
02
;
const
ERROR_NO_TARGET_PATH_FILE_NAME
=
1
5
03
;
// KeyValueParser
const
ERROR_KVP_VALUE_HAS_NO_KEY
=
1900
;
...
...
extension/qfq/qfq/Database.php
View file @
f000706b
...
...
@@ -567,4 +567,27 @@ class Database {
return
$this
->
mysqli
->
insert_id
;
}
/**
* Searches for the table '$name'.
*
* @param $name
* @return bool true if found, else false
*/
public
function
existTable
(
$name
)
{
$found
=
false
;
$tables
=
$this
->
sql
(
"SHOW tables"
);
foreach
(
$tables
as
$t
)
{
foreach
(
$t
as
$key
=>
$value
)
{
if
(
$value
===
$name
)
{
$found
=
true
;
break
2
;
}
}
}
return
$found
;
}
}
\ No newline at end of file
extension/qfq/qfq/QuickFormQuery.php
View file @
f000706b
...
...
@@ -319,6 +319,10 @@ class QuickFormQuery {
return
false
;
}
if
(
!
$this
->
db
->
existTable
(
'Form'
))
{
throw
new
UserFormException
(
"Table 'Form' not found"
,
ERROR_MISSING_TABLE
);
}
// Preparation for Log, Debug
$this
->
store
->
setVar
(
SYSTEM_FORM
,
$formName
,
STORE_SYSTEM
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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