From c4f4a834a7163cad734666015181192178e191da Mon Sep 17 00:00:00 2001 From: gggeek Date: Fri, 3 Dec 2021 14:18:59 +0100 Subject: [PATCH] Better custom checks on node aliases --- doc/changelogs/changelog-0.25.0-to-0.26.0 | 4 ++++ extension.xml | 2 +- ezinfo.php | 2 +- settings/ezdbintegrity.ini | 5 +++-- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 doc/changelogs/changelog-0.25.0-to-0.26.0 diff --git a/doc/changelogs/changelog-0.25.0-to-0.26.0 b/doc/changelogs/changelog-0.25.0-to-0.26.0 new file mode 100644 index 0000000..09d1d9d --- /dev/null +++ b/doc/changelogs/changelog-0.25.0-to-0.26.0 @@ -0,0 +1,4 @@ +changelog from version 0.25.0 to 0.26.0 + +. fixed: custom query to find nodes without an urlalias +. added: custom query to find custom aliases with non existing target node diff --git a/extension.xml b/extension.xml index f4131f2..2e9927c 100644 --- a/extension.xml +++ b/extension.xml @@ -2,7 +2,7 @@ eZ DB Integrity extension - 0.25.0 + 0.26.0 Copyright (C) 2014-2021 Gaetano Giunta GNU General Public License v2.0 diff --git a/ezinfo.php b/ezinfo.php index 4a78ec1..e20b8f3 100644 --- a/ezinfo.php +++ b/ezinfo.php @@ -6,7 +6,7 @@ static function info() { return array( 'Name' => "eZ DB Integrity extension", - 'Version' => "0.25.0", + 'Version' => "0.26.0", 'Copyright' => "Copyright (C) 2014-2021 Gaetano Giunta", 'License' => "GNU General Public License v2.0" ); diff --git a/settings/ezdbintegrity.ini b/settings/ezdbintegrity.ini index e08cfeb..f54403b 100644 --- a/settings/ezdbintegrity.ini +++ b/settings/ezdbintegrity.ini @@ -295,8 +295,9 @@ visible_but_hidden_nodes[sql]=SELECT node_id, is_hidden, is_invisible FROM ezcon nodes_with_wrong_path[sql]=SELECT c.node_id, c.path_string, p.path_string as parent_path_string FROM ezcontentobject_tree c, ezcontentobject_tree p WHERE c.parent_node_id = p.node_id AND c.path_string NOT REGEXP CONCAT('^', p.path_string, c.node_id, '/$') AND c.node_id <> 1 nodes_with_wrong_depth[sql]=SELECT c.node_id FROM ezcontentobject_tree c, ezcontentobject_tree p WHERE c.parent_node_id = p.node_id AND c.depth != ( p.depth + 1 ) AND c.node_id != 1 -urlaliases_without_nodes[sql]=SELECT parent, text_md5, action FROM ezurlalias_ml LEFT JOIN ezcontentobject_tree ON substr(action, 8) = node_id WHERE action_type = 'eznode' AND is_original = 1 AND node_id is null -nodes_without_urlaliases[sql]=SELECT node_id FROM ezcontentobject_tree LEFT JOIN ezurlalias_ml ON node_id = substr(action, 8) WHERE depth > 0 AND action_type = 'eznode' AND is_original = 1 AND ezurlalias_ml.id IS NULL +urlaliases_without_nodes[sql]=SELECT parent, text_md5, action FROM ezurlalias_ml LEFT JOIN ezcontentobject_tree ON substr(action, 8) = node_id WHERE action_type = 'eznode' AND is_original = 1 AND node_id IS NULL +nodes_without_urlaliases[sql]=SELECT node_id FROM ezcontentobject_tree LEFT JOIN ezurlalias_ml ON action = concat('eznode:', node_id) WHERE contentobject_id != 0 AND (is_original = 1 OR is_original IS NULL) AND (is_alias = 0 or is_alias IS NULL) AND ezurlalias_ml.id IS NULL +custom_aliases_without_nodes[sql]=SELECT id, destination_url FROM ezurlalias LEFT JOIN ezcontentobject_tree l ON destination_url = concat('content/view/full/', l.node_id) WHERE destination_url LIKE 'content/view/full/%' AND l.node_id IS NULL policy_limitations_for_missing_subtrees[sql]= SELECT p.role_id, p.id as policy_id, p.module_name, p.function_name, l.identifier, v.value FROM ezpolicy_limitation_value v JOIN ezpolicy_limitation l ON v.limitation_id = l.id JOIN ezpolicy p ON l.policy_id = p.id LEFT JOIN ezcontentobject_tree n ON v.value = n.path_string WHERE l.identifier = 'Subtree' AND n.node_id IS NULL ORDER BY p.role_id, p.module_name, p.function_name, p.id, v.value policy_limitations_for_missing_locations[sql]=SELECT p.role_id, p.id as policy_id, p.module_name, p.function_name, l.identifier, v.value FROM ezpolicy_limitation_value v JOIN ezpolicy_limitation l ON v.limitation_id = l.id JOIN ezpolicy p ON l.policy_id = p.id LEFT JOIN ezcontentobject_tree n ON v.value = n.node_id WHERE l.identifier = 'Node' AND n.node_id IS NULL ORDER BY p.role_id, p.module_name, p.function_name, p.id, v.value