Skip to content

Conversation

@emteknetnz
Copy link
Member

@emteknetnz emteknetnz commented Jan 23, 2026

Issue #1405

Requires silverstripe/silverstripe-frameworktest#257 for behat to go green

@emteknetnz emteknetnz mentioned this pull request Jan 23, 2026
@emteknetnz emteknetnz marked this pull request as ready for review January 23, 2026 03:12
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this PR would be hiding a bug - we shouldn't need a CMSEditLink in order to add a non-inline-editable block to a DataObject.

@emteknetnz
Copy link
Member Author

Perhaps? I don't have a lot of context on this one, I just traced it back to this PR so I restored edit link functionality.

Do you have context on this one?

@GuySartorelli
Copy link
Member

I don't have enough context to know what the underlying cause of the failure is, but I do know that we shouldn't need an edit link on the parent in order for the steps in this behat feature to pass.

@emteknetnz
Copy link
Member Author

emteknetnz commented Jan 27, 2026

It looks like this PR would be hiding a bug - we shouldn't need a CMSEditLink in order to add a non-inline-editable block to a DataObject.

Not to add, to edit the block - failing test is https://github.com/silverstripe/silverstripe-elemental/blob/6/tests/Behat/features/add-block-element-to-data-object.feature#L26 which has Given content blocks are not in-line editable

It needs the CMSEditLink() here https://github.com/silverstripe/silverstripe-elemental/blob/6.1/src/Models/BaseElement.php#L877

Note that $page the parent DataObject, not specifcally a Page, and I think that // In-line editable blocks should just take you to the page. is supposed to be Non-inline editable

If $link is null (which happens when we are missing that extension I added in this PR), then there's no logic to handle it .. which makes sense? Seems like you'd need a nested /ItemEditForm path to generate a form to edit the block?

Call stack to get to that code is

BaseElement::getElementCMSLink()
BaseElement::getCMSEditLink()
BaseElement::getEditLink()
BaseElement::provideBlockSchema()
BaseElement::getBlockSchema()
ElementaAreaController::apiReadElements()

@GuySartorelli
Copy link
Member

Ahhhh yup that makes sense. In that case I think it should fail with a hard exception that has a clear message, instead of just trying to navigate to... somewhere?

We should also ensure that the documentation calls our this requirement.

@emteknetnz
Copy link
Member Author

emteknetnz commented Jan 28, 2026

Have created a new issue for the hard exception - behavioral change so needs to be in a new minor

We still need these PRs to fix 6.1 CI

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GuySartorelli GuySartorelli merged commit 1543254 into silverstripe:6.1 Jan 28, 2026
71 of 74 checks passed
@GuySartorelli GuySartorelli deleted the pulls/6.1/fix-behat branch January 28, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants