Jdforrester-WMF added a comment.

The MediaInfoContent class can just override the isValid() method, call $this->getMediaInfo()->getDescriptions(), and return false of that is not empty. This will prevent any MediaInfo to be stored if it has any descriptions set.

Other code that can provide a helpful message to the user should also do this check. isValid() is really the fail-safe.

Aha, it was the jump from MediaInfoContent up to the MediaInfo class that confused me. Yeah, this works, but will presumably need us to remove all existing descriptions from production before deploying as otherwise those pages will be invalid stored content and so won't be editable any more?


TASK DETAIL
https://phabricator.wikimedia.org/T214692

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Jdforrester-WMF
Cc: gerritbot, daniel, Jdforrester-WMF, Ramsey-WMF, Aklapper, Bugreporter, CucyNoiD, Nandana, NebulousIris, JKSTNK, Gaboe420, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, PDrouin-WMF, Gq86, Baloch007, E1presidente, Cparle, Darkminds3113, Anooprao, SandraF_WMF, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, Tramullas, Acer, V4switch, LawExplorer, Lewizho99, Maathavan, Silverfish, _jensen, Susannaanas, Wong128hk, Jane023, Wikidata-bugs, Base, matthiasmullie, aude, Ricordisamoa, Wesalius, Lydia_Pintscher, Fabrice_Florin, Raymond, Steinsplitter, Matanya, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to