Skip to content

Commit cdeca85

Browse files
committed
Prevent folder items state updates
1 parent 247434a commit cdeca85

File tree

1 file changed

+8
-1
lines changed
  • src/main/resources/org/craftercms/studio/api/v2/dal

1 file changed

+8
-1
lines changed

src/main/resources/org/craftercms/studio/api/v2/dal/ItemDAO.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@
351351
<foreach collection="paths" item="path" index="index" open="(" separator="," close=")">
352352
#{path}
353353
</foreach>
354+
AND system_type = '${systemTypeFolder}'
354355
</update>
355356

356357
<update id="resetStatesBySiteAndPathBulk">
@@ -359,6 +360,7 @@
359360
<foreach collection="paths" item="path" index="index" open="(" separator="," close=")">
360361
#{path}
361362
</foreach>
363+
AND system_type = '${systemTypeFolder}'
362364
</update>
363365

364366
<update id="updateStatesBySiteAndPathBulk">
@@ -367,6 +369,7 @@
367369
<foreach collection="paths" item="path" index="index" open="(" separator="," close=")">
368370
#{path}
369371
</foreach>
372+
AND system_type = '${systemTypeFolder}'
370373
</update>
371374

372375
<update id="moveItemInternal">
@@ -524,6 +527,7 @@
524527
<if test="statesBitMap != null">
525528
AND (i.state &amp; #{statesBitMap}) &gt; 0
526529
</if>
530+
AND i.system_type = '${systemTypeFolder}'
527531
</update>
528532

529533
<update id="updateNewPageChildren">
@@ -666,7 +670,10 @@
666670
SET
667671
path = REPLACE(path, #{previousPath}, #{newPath}),
668672
locked_by = NULL,
669-
state = (state | #{onStatesBitMap}) &amp; ~#{offStatesBitMap}
673+
state = CASE
674+
WHEN system_type = '${systemTypeFolder}' THEN 0
675+
ELSE (state | #{onStatesBitMap}) &amp; ~#{offStatesBitMap}
676+
END
670677
WHERE
671678
site_id = #{siteId}
672679
AND (path = #{previousPath} OR path LIKE CONCAT(#{previousPath}, '/%'));

0 commit comments

Comments
 (0)