- Issue created by @nkoporec
- Status changed to Needs review
8 months ago 2:59pm 23 May 2024
The updateAllLeavesAfterRightValue() is returning a SQL error when running the project using the SQLITE database. The issue is that the query produced in the method is not SQLITE compatible, since its not supporting JOINS within the UPDATE statement, per https://stackoverflow.com/questions/773441/how-do-i-make-an-update-while...
Install Drupal with sqlite database.
Install the module and try to programetically add a subgroup to a parent eg:
$group->addRelationship($subgroup, 'subgroup:' . $subgroup->bundle());
The error is:
* Error message: SQLSTATE[HY000]: General error: 1 near "t1": syntax error:
UPDATE "test87980565"."group__subgroup_right" t1
INNER JOIN "test87980565"."group__subgroup_tree" t2 ON t1.entity_id = t2.entity_id
SET t1.subgroup_right_value = t1.subgroup_right_value + 2
WHERE t1.subgroup_right_value >= 2
AND t2.subgroup_tree_value = 1; Array
(
)
Update the statement and use a sqlite compatible query.
Needs review
3.0
Code