[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_admin/sql/updates/mysql/ -> 4.0.0-2021-08-13.sql (source)

   1  --
   2  -- Fix wrong asset name for com_content basic workflow stage if a new asset with the right
   3  -- name hasn't been created yet when saving the workflow stage in backend in past.
   4  --
   5  UPDATE `#__assets`
   6     SET `name` = 'com_content.stage.1'
   7   WHERE `name` = 'com_content.state.1'
   8     AND (SELECT c.`count` FROM (SELECT COUNT(b.`id`) AS `count` FROM `#__assets` b WHERE b.`name` = 'com_content.stage.1') AS c) = 0;
   9  
  10  --
  11  -- Fix wrong asset titles for workflow transitions
  12  --
  13  UPDATE `#__assets` SET `title` = 'Unpublish' WHERE `name` = 'com_content.transition.1' AND `title` = 'Publish';
  14  UPDATE `#__assets` SET `title` = 'Publish'   WHERE `name` = 'com_content.transition.2' AND `title` = 'Unpublish';
  15  UPDATE `#__assets` SET `title` = 'Trash'     WHERE `name` = 'com_content.transition.3' AND `title` = 'Archive';
  16  UPDATE `#__assets` SET `title` = 'Archive'   WHERE `name` = 'com_content.transition.4' AND `title` = 'Trash';
  17  
  18  --
  19  -- Set asset ID of com_content basic workflow stage to the right value if not already set.
  20  -- The right value is either the asset fixed with the first update statement at the top
  21  -- of this file or a new asset which has been created yet when saving the workflow stage
  22  -- in backend in past.
  23  --
  24  UPDATE `#__workflow_stages` s
  25   INNER JOIN (SELECT `name`, MAX(`id`) AS `id` FROM `#__assets` GROUP BY `name`) AS a ON a.`name` = CONCAT('com_content.stage.', s.`id`)
  26     SET s.`asset_id` = a.`id`
  27   WHERE s.`id` = 1
  28     AND s.`asset_id` = 0;


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer