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
dc4271bf
Commit
dc4271bf
authored
Mar 20, 2021
by
Carsten Rose
Browse files
Refs #11998 - By theory, getBodyText() should now be MultiDB aware.
parent
1c09b4e2
Pipeline
#5054
passed with stages
in 3 minutes and 51 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Documentation/Concept.rst
View file @
dc4271bf
...
...
@@ -320,8 +320,8 @@ In :ref:`config-qfq-php` mutliple database credentials can be prepared. Mandator
`DB_1_USER`, `DB_1_SERVER`, `DB_1_PASSWORD`, `DB_1_NAME`. The number '1' indicates the `dbIndex`. Increment the number
to specify further database credential setups.
Typically the credentials for `DB_1`
also have access to the T3 database.
By convention, it's necessary that `DB_1` is the one who
also have access to the T
ypo
3 database.
E.q. `QFQ Function`_ or
download links (based on QFQ functions) needs access to the T3 database to directly fetch tt-content records.
Different QFQ versions, shared database
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
...
extension/Classes/Core/Constants.php
View file @
dc4271bf
...
...
@@ -490,9 +490,6 @@ const SYSTEM_DB_INIT = 'init';
const
SYSTEM_DB_INDEX_DATA
=
"indexData"
;
const
SYSTEM_DB_INDEX_QFQ
=
"indexQfq"
;
//const SYSTEM_DB_INDEX_DATA_DEPRECATED = "DB_INDEX_DATA";
//const SYSTEM_DB_INDEX_QFQ_DEPRECATED = "DB_INDEX_QFQ";
// Automatically filled by QFQ
const
SYSTEM_DB_NAME_DATA
=
'dbNameData'
;
const
SYSTEM_DB_NAME_QFQ
=
'dbNameQfq'
;
...
...
@@ -1010,6 +1007,7 @@ const F_PARAMETER = 'parameter'; // valid for F_ and FE_
// Form columns: via parameter field
const
F_DB_INDEX
=
'dbIndex'
;
const
DB_INDEX_DEFAULT
=
"1"
;
const
DB_INDEX_T3
=
DB_INDEX_DEFAULT
;
const
PARAM_DB_INDEX_DATA
=
'__dbIndexData'
;
// Submitted via SIP to make record locking DB aware.
const
F_FORM_SUBMIT_LOG_MODE
=
'formSubmitLogMode'
;
...
...
extension/Classes/Core/Database/Database.php
View file @
dc4271bf
...
...
@@ -54,7 +54,8 @@ class Database {
*/
private
$sqlLogModePrio
=
[
SQL_LOG_MODE_NONE
=>
1
,
SQL_LOG_MODE_ERROR
=>
2
,
SQL_LOG_MODE_MODIFY
=>
3
,
SQL_LOG_MODE_ALL
=>
4
];
private
$dbName
=
''
;
private
$dbName
=
null
;
private
$dbIndex
=
null
;
/**
* Returns current data base handle from Store[System][SYSTEM_DBH].
...
...
@@ -72,6 +73,7 @@ class Database {
if
(
empty
(
$dbIndex
))
{
$dbIndex
=
DB_INDEX_DEFAULT
;
}
$this
->
dbIndex
=
$dbIndex
;
$this
->
store
=
Store
::
getInstance
();
$storeSystem
=
$this
->
store
->
getStore
(
STORE_SYSTEM
);
...
...
@@ -98,6 +100,13 @@ class Database {
}
}
/**
* @return mixed|string
*/
public
function
getDbIndex
()
{
return
$this
->
dbIndex
;
}
/**
* @return mixed|string
*/
...
...
extension/Classes/Core/Report/Report.php
View file @
dc4271bf
...
...
@@ -463,7 +463,13 @@ class Report {
if
(
isset
(
$functionCache
[
$rcFunctionName
]))
{
$bodytextArr
=
$functionCache
[
$rcFunctionName
];
}
else
{
$bodytextArr
=
$this
->
db
->
getBodyText
(
$rcFunctionName
);
if
(
DB_INDEX_T3
!=
$this
->
db
->
getDbIndex
())
{
$db
=
new
Database
(
DB_INDEX_T3
);
}
else
{
$db
=
$this
->
db
;
}
$bodytextArr
=
$db
->
getBodyText
(
$rcFunctionName
);
$btp
=
new
BodytextParser
();
$bodytextArr
[
T3DATA_BODYTEXT
]
=
$btp
->
process
(
$bodytextArr
[
T3DATA_BODYTEXT
]);
...
...
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