<table><tr><td style="">dkurz created this revision.<br />dkurz added a reviewer: KDE PIM.<br />Herald added a project: KDE PIM.<br />Herald added a subscriber: kde-pim.<br />dkurz requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D16051">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Use default value for NULL columns.</p>

<p>Without this patch, possibly different default values are used for<br />
entity construction (default from akonadidb.xml) and when reading a row<br />
from the database (default-constructed), resulting in inconsistencies.<br />
For example, when modifying a Tag, the resulting Tag modify notification<br />
indicates that the new parentId of the modified Tag is 0<br />
(default-constructed qint64), whereas Tags without parents are<br />
initialized with parentId -1. This patch fixes these inconsistencies by<br />
considering the "default" value from akonadidb.xml for row-to-entity<br />
conversion, too.</p>

<p>Set default Tag::parentId to -1.</p>

<p>A parentless Tag is initialized with parentId -1, so we should also<br />
report that when reading a Tag from the database where the parentId<br />
field is NULL.</p>

<p>BUG: 398459<br />
FIXED-IN: 5.9.3</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>KOrganizer stops crashing on category color customization<br />
with this patch. More detailed test plan suggestions welcome.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R165 Akonadi </div></div></div><br /><div><strong>BRANCH</strong><div><div>hotfix/fix-crash-on-tag-modification</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D16051">https://phabricator.kde.org/D16051</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/server/storage/akonadidb.xml<br />
src/server/storage/entities.xsl</div></div></div><br /><div><strong>To: </strong>dkurz, KDE PIM<br /><strong>Cc: </strong>kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil<br /></div>