https://bugzilla.wikimedia.org/show_bug.cgi?id=40295
--- Comment #4 from Daniel Kinzler <[email protected]> 2012-09-18 09:17:03 UTC --- Hm... thinking about equals() vs. hasSameContent(): Note that we are free to define the equals function in Entity as we like, but the equals function in EntityContent is defined by the Content interface and used by WikiPage::doEditContent (which is called by EntityContent::save). It's used to determine whether the new content is the same as the previous content, in which case a "null edit" is triggered and no new revision is created in the database. The reason I made equals lenient about missing IDs is this: if I want to store a new revision of an item, and to do so I construct a fresh Entity and EntityContent and then tell WikiPage to save it, the new content object may not yet have an ID attached. So equals() would fail without need when comparing the new version to the previous one. Hm... this could also be solved by forcing the new content to have an ID. This should probably be done anyway, for consistency. And if it already has an ID that is different from the previous item's ID, the save should probably fail - I can't think of a valid reason to allow this. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
