Skip to content

BadMethodCallException (CMSEditLink not found) #1

@phptek

Description

@phptek

PHP 7.1 / Ubuntu 16.04 / silverstripe/framework 4.3.3

HistoryGridFieldItemRequest on line 138 expects decorated objects to feature a CMSEditLink() method, but doesn't enforce / indicate this requirement anywhere.

CMSEditLink() comes from silverstripe/framework, in the CMSPreviewable interface, and I would expect decorated objects to throw an exception far earlier in the control chain, if not on install (dev/build). If going with the latter idea, then declaring an add_to_class() or a constructor on method the DataObjectHistory extension and checking that the decorated object implements CMSPreviewable, would be the way to go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions