X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FStorage%2FSlotRecord.php;h=c7eb735db37f71ce29b5ae1f5ee1220e7f524fce;hb=4df0c71911500466a6330b8fe29c623ef5b51e41;hp=e63dd3c3553ff3a3c587ab78c967d73340369ab0;hpb=81443e3fc8dcdfdf10735f6db77a0a52284ebcc1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Storage/SlotRecord.php b/includes/Storage/SlotRecord.php index e63dd3c355..c7eb735db3 100644 --- a/includes/Storage/SlotRecord.php +++ b/includes/Storage/SlotRecord.php @@ -234,11 +234,6 @@ class SlotRecord { Assert::parameterType( 'object', $row, '$row' ); Assert::parameterType( 'Content|callable', $content, '$content' ); - Assert::parameter( - property_exists( $row, 'slot_id' ), - '$row->slot_id', - 'must exist' - ); Assert::parameter( property_exists( $row, 'slot_revision_id' ), '$row->slot_revision_id', @@ -456,6 +451,16 @@ class SlotRecord { * content has been stored in the content table. While building a new revision, * SlotRecords will not have an ID associated. * + * Also, during schema migration, hasContentId() may return false when encountering an + * un-migrated database entry in SCHEMA_COMPAT_WRITE_BOTH mode. + * It will however always return true for saved revisions on SCHEMA_COMPAT_READ_NEW mode, + * or without SCHEMA_COMPAT_WRITE_NEW mode. In the latter case, an emulated content ID + * is used, derived from the revision's text ID. + * + * Note that hasContentId() returning false while hasRevision() returns true always + * indicates an unmigrated row in SCHEMA_COMPAT_WRITE_BOTH mode, as described above. + * For an unsaved slot, both these methods would return false. + * * @since 1.32 * * @return bool @@ -499,6 +504,9 @@ class SlotRecord { * This information should be irrelevant to application logic, it is here to allow * the construction of a full row for the revision table. * + * Note that this method may return an emulated value during schema migration in + * SCHEMA_COMPAT_WRITE_OLD mode. See RevisionStore::emulateContentId for more information. + * * @return int */ public function getContentId() {