Skip to content

Commit

Permalink
add one check; improve two; bump version nr
Browse files Browse the repository at this point in the history
  • Loading branch information
gggeek committed Mar 11, 2023
1 parent 4b2e651 commit 4c457d5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
6 changes: 6 additions & 0 deletions doc/changelogs/changelog-0.27.1-to-0.28.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
changelog from version 0.27.1 to 0.28.0

. added one SQL check for ezurl items not present in ezurl_object_link

. changed the custom queries used to look for orphan rows in ezm_block to make them fast. Side effect: they only work
with mysql/mariadb now
4 changes: 2 additions & 2 deletions extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<software>
<metadata>
<name>eZ DB Integrity extension</name>
<version>0.27.1</version>
<copyright>Copyright (C) 2014-2022 Gaetano Giunta</copyright>
<version>0.28.0</version>
<copyright>Copyright (C) 2014-2023 Gaetano Giunta</copyright>
<license>GNU General Public License v2.0</license>
</metadata>

Expand Down
4 changes: 2 additions & 2 deletions ezinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ static function info()
{
return array(
'Name' => "<a href=\"https://github.com/gggeek/ezdbintegrity\">eZ DB Integrity extension</a>",
'Version' => "0.27.1",
'Copyright' => "Copyright (C) 2014-2022 Gaetano Giunta",
'Version' => "0.28.0",
'Copyright' => "Copyright (C) 2014-2023 Gaetano Giunta",
'License' => "GNU General Public License v2.0"
);
}
Expand Down
11 changes: 6 additions & 5 deletions settings/ezdbintegrity.ini
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ eztags_attribute_link[]=keyword_id::eztags::id
eztags_attribute_link[]=objectattribute_id,objectattribute_version::ezcontentobject_attribute::id,version
eztipafriend_counter[]=node_id::ezcontentobject_tree::node_id
eztrigger[]=workflow_id::ezworkflow::id
ezurl[]=id::ezurl_object_link::url_id
ezurl_object_link[]=contentobject_attribute_id,contentobject_attribute_version::ezcontentobject_attribute::id,version
ezurl_object_link[]=url_id::ezurl::id
ezurlalias_ml[]=parent::ezurlalias_ml::id::ezurlalias_ml.parent <> 0
Expand Down Expand Up @@ -280,8 +281,8 @@ objects_with_many_published_versions[sql]=SELECT contentobject_id, count(*) FROM
objects_with_many_states_in_one_group[sql]=SELECT l.contentobject_id, s.group_id, count(*) as count FROM ezcobj_state s, ezcobj_state_link l WHERE l.contentobject_state_id = s.id GROUP BY s.group_id, l.contentobject_id HAVING count(*) > 1
objects_with_wrong_number_of_states_assigned[sql]=SELECT contentobject_id, count(*) as states FROM ezcobj_state_link l GROUP BY l.contentobject_id HAVING count(*) != (SELECT count(*) FROM ezcobj_state_group)
# @todo we should really check using AND on languages table
objects_without_languages[sql]= SELECT id FROM ezcontentobject WHERE language_mask = 0
object_versions_without_languages[sql]= SELECT id FROM ezcontentobject_version WHERE language_mask = 0
objects_without_languages[sql]=SELECT id FROM ezcontentobject WHERE language_mask = 0
object_versions_without_languages[sql]=SELECT id FROM ezcontentobject_version WHERE language_mask = 0
objects_versions_with_bad_attribute_count[sql]=select * from ( select count(*) as objattributes, contentobject_id, version, language_code, contentclass_id as contentclass_id_o from ezcontentobject_attribute coa, ezcontentobject co where coa.contentobject_id = co.id group by version, contentobject_id, contentclass_id, language_code ) q1, ( select count(*) as classattributes, contentclass_id from ezcontentclass_attribute cca, ezcontentclass cc where cca.contentclass_id = cc.id and cca.version = cc.version and cc.version = 0 group by cc.id, cc.version ) q2 where q1.contentclass_id_o = q2.contentclass_id and q1.objattributes <> q2.classattributes
# for the one below, do we need to account as well for version states 2 and 4 ?
#draft_objects_with_no_draft_versions[sql]=SELECT * FROM ezcontentobject WHERE status = 0 AND id NOT IN ( SELECT contentobject_id FROM ezcontentobject_version WHERE status IN (0, 5) )
Expand Down Expand Up @@ -310,6 +311,6 @@ policy_limitations_for_missing_states[sql]= SELECT p.role_id, p.id as policy_i
# @todo: ezcontentobject_link where contentclassattribute_id = 0 and relation_type = 8 (and vice-versa)

# nb: the following 2 queries assume there are no other datatypes besides 'ezpage' which are linked to data in ezm_block table
# nb: the following query can create a huge temp table!
ezflow_blocks_with_invalid_zones[sql]=SELECT * FROM ezm_block WHERE zone_id NOT IN ( SELECT DISTINCT( SUBSTRING( a.data_text, LOCATE( '<zone id="id_', a.data_text ) +13, 32 ) ) AS existing_zone_id FROM ezcontentobject_attribute a, ezcontentobject_version v WHERE a.version = v.version AND a.contentobject_id = v.contentobject_id AND a.data_type_string = 'ezpage' )
leftover_ezflow_blocks[sql]=SELECT * FROM ezm_block WHERE id NOT IN (SELECT DISTINCT(b.id) FROM ezm_block b, ezcontentobject_attribute a WHERE a.data_text like concat('%', b.id, '%') AND a.contentclassattribute_id IN (SELECT id from ezcontentclass_attribute WHERE data_type_string = 'ezpage'))
# @todo ExtractValue is a mysql-ism
ezflow_blocks_with_unused_zones[sql]=SELECT * FROM ezm_block WHERE id NOT IN (SELECT DISTINCT(id) FROM ezm_block b1, (SELECT DISTINCT(TRIM(REPLACE(ExtractValue(data_text, '/page/zone/@id'), 'id_', ''))) AS zoneids FROM ezcontentobject_attribute a WHERE a.data_type_string = 'ezpage' AND a.data_text IS NOT NULL) t WHERE t.zoneids LIKE (concat('%', b1.zone_id, '%')))
leftover_ezflow_blocks[sql]=SELECT * FROM ezm_block WHERE id NOT IN (SELECT DISTINCT(id) FROM ezm_block b1, (SELECT DISTINCT(TRIM(REPLACE(ExtractValue(data_text, '/page/zone/block/@id'), 'id_', ''))) AS blockids FROM ezcontentobject_attribute a WHERE a.data_type_string = 'ezpage' AND a.data_text IS NOT NULL) t WHERE t.blockids LIKE (concat('%', b1.id, '%')))

0 comments on commit 4c457d5

Please sign in to comment.