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
9d064a3b
Commit
9d064a3b
authored
Feb 18, 2018
by
Carsten Rose
Browse files
MultiDB: fix problem with deleting records
parent
575bf775
Changes
3
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/Delete.php
View file @
9d064a3b
...
@@ -25,10 +25,12 @@ class Delete {
...
@@ -25,10 +25,12 @@ class Delete {
private
$store
=
null
;
private
$store
=
null
;
/**
/**
*
* @param bool $dbIndexData
* @param bool $phpUnit
*/
*/
public
function
__construct
(
$phpUnit
=
false
)
{
public
function
__construct
(
$dbIndexData
=
false
,
$phpUnit
=
false
)
{
$this
->
db
=
new
Database
();
$this
->
db
=
new
Database
(
$dbIndexData
);
$this
->
store
=
Store
::
getInstance
(
''
,
$phpUnit
);
$this
->
store
=
Store
::
getInstance
(
''
,
$phpUnit
);
}
}
...
...
extension/qfq/qfq/QuickFormQuery.php
View file @
9d064a3b
...
@@ -305,6 +305,16 @@ class QuickFormQuery {
...
@@ -305,6 +305,16 @@ class QuickFormQuery {
$this
->
formSpec
[
F_TABLE_NAME
]
=
$table
;
$this
->
formSpec
[
F_TABLE_NAME
]
=
$table
;
$this
->
formSpec
[
F_RECORD_LOCK_TIMEOUT_SECONDS
]
=
1
;
// just indicate a timeout, the exact timeout is stored in the dirty record.
$this
->
formSpec
[
F_RECORD_LOCK_TIMEOUT_SECONDS
]
=
1
;
// just indicate a timeout, the exact timeout is stored in the dirty record.
$this
->
formSpec
[
F_DIRTY_MODE
]
=
DIRTY_MODE_EXCLUSIVE
;
// just set a mode,, the exact mode is stored in the dirty record.
$this
->
formSpec
[
F_DIRTY_MODE
]
=
DIRTY_MODE_EXCLUSIVE
;
// just set a mode,, the exact mode is stored in the dirty record.
$tmpDbIndexData
=
$this
->
store
->
getVar
(
PARAM_DB_INDEX_DATA
,
STORE_SIP
);
if
(
!
empty
(
$tmpDbIndexData
))
{
$this
->
formSpec
[
F_DB_INDEX
]
=
$tmpDbIndexData
;
if
(
$tmpDbIndexData
!=
$this
->
dbIndexData
)
{
if
(
!
isset
(
$this
->
dbArray
[
$tmpDbIndexData
]))
{
$this
->
dbArray
[
$tmpDbIndexData
]
=
new
Database
(
$tmpDbIndexData
);
}
}
}
}
}
// For 'new' record always create a new Browser TAB-uniq (for this current form, nowhere else used) SIP.
// For 'new' record always create a new Browser TAB-uniq (for this current form, nowhere else used) SIP.
...
@@ -344,10 +354,10 @@ class QuickFormQuery {
...
@@ -344,10 +354,10 @@ class QuickFormQuery {
if
(
$formMode
===
FORM_DELETE
)
{
if
(
$formMode
===
FORM_DELETE
)
{
$build
=
new
Delete
();
$build
=
new
Delete
(
$this
->
dbIndexData
);
}
else
{
}
else
{
$tableDefinition
=
$this
->
dbArray
[
$this
->
dbIndexData
]
->
getTableDefinition
(
$this
->
formSpec
[
F_TABLE_NAME
]);
$tableDefinition
=
$this
->
dbArray
[
$this
->
dbIndexData
]
->
getTableDefinition
(
$this
->
formSpec
[
F_TABLE_NAME
]);
$this
->
store
->
fillStoreTableDefaultColumnType
(
$tableDefinition
);
$this
->
store
->
fillStoreTableDefaultColumnType
(
$tableDefinition
);
switch
(
$this
->
formSpec
[
'render'
])
{
switch
(
$this
->
formSpec
[
'render'
])
{
...
...
extension/qfq/qfq/database/Database.php
View file @
9d064a3b
...
@@ -68,8 +68,10 @@ class Database {
...
@@ -68,8 +68,10 @@ class Database {
* @throws DbException
* @throws DbException
* @throws UserFormException
* @throws UserFormException
*/
*/
public
function
__construct
(
$dbIndex
=
1
)
{
public
function
__construct
(
$dbIndex
=
DB_INDEX_DEFAULT
)
{
$dbInit
=
''
;
if
(
empty
(
$dbIndex
))
{
$dbIndex
=
DB_INDEX_DEFAULT
;
}
$this
->
store
=
Store
::
getInstance
();
$this
->
store
=
Store
::
getInstance
();
$storeSystem
=
$this
->
store
->
getStore
(
STORE_SYSTEM
);
$storeSystem
=
$this
->
store
->
getStore
(
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