Skip to content

Commit

Permalink
Better custom checks on node aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
gggeek committed Dec 3, 2021
1 parent 9243756 commit c4f4a83
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions doc/changelogs/changelog-0.25.0-to-0.26.0
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<software>
<metadata>
<name>eZ DB Integrity extension</name>
<version>0.25.0</version>
<version>0.26.0</version>
<copyright>Copyright (C) 2014-2021 Gaetano Giunta</copyright>
<license>GNU General Public License v2.0</license>
</metadata>
Expand Down
2 changes: 1 addition & 1 deletion ezinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ static function info()
{
return array(
'Name' => "<a href=\"https://github.com/gggeek/ezdbintegrity\">eZ DB Integrity extension</a>",
'Version' => "0.25.0",
'Version' => "0.26.0",
'Copyright' => "Copyright (C) 2014-2021 Gaetano Giunta",
'License' => "GNU General Public License v2.0"
);
Expand Down
5 changes: 3 additions & 2 deletions settings/ezdbintegrity.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c4f4a83

Please sign in to comment.