updateAllLeavesAfterRightValue() is returning a SQL error

Created on 23 May 2024, about 1 month ago

Problem/Motivation

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...

Steps to reproduce

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
(
)

Proposed resolution

Update the statement and use a sqlite compatible query.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇸🇮Slovenia nkoporec Slovenia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024