silverstripe / silverstripe-linkfield

Silverstripe module for managing links
BSD 3-Clause "New" or "Revised" License
4 stars 14 forks source link

ENH Better versioned history #209

Closed emteknetnz closed 4 months ago

emteknetnz commented 5 months ago

Issue https://github.com/silverstripe/silverstripe-linkfield/issues/10

May require https://github.com/silverstripe/silverstripe-versioned-admin/issues/198 to be merged in order for archive admin to work properly

Note that for elemental page history where you have block with a has_one linkfield on it, the value for this nested field will not display. This is consistent with nested file's not showing on the history of an elemental-file-block with a linked file on it which also does not show on the page history. In both instances, clicking on the "Block history" link will show the value of nested field

emteknetnz commented 4 months ago

Archived Admin uses the same behaviour as Versionned Admin when displaying link.

ArchivedAdmin support adds a level of complexity over the regular history viewer that I don't think is worth it. We need to support multiple permutations of owner and links archived and not-archived. The LinkFieldController which handles all the data isn't aware of this. We also need to add support for knowing if we're even in an archived admin which is very messy because of the special treatment given to SiteTree vs other dataobjects.

LinkField on versioned history view correctly identify if a Link was attached to the page, but the Link was deleted.

This relates to the point above. Because the link was deleted then when attempting to fetch the link via LinkFieldController it will return a 404. We could change the message from "Failed to load link(s)" to "Link was deleted" ... but then again that's an assumption because it may be 404'ing for a different reason. I'd say it's such a minor point we should just leave as is.

Issue with archived history

I was unable to replicate this issue