Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For some really odd reason, I cannot get the override to the gridextension to allow for unlinking blocks to work. I only get the archive option. Any idea what could cause this? #7

Open
aNorthernSoul opened this issue Mar 26, 2019 · 4 comments

Comments

@aNorthernSoul
Copy link

No description provided.

@aNorthernSoul
Copy link
Author

For some really odd reason, I cannot get the override to the gridextension to allow for unlinking blocks to work. I only get the archive option. Any idea what could cause this? It's a pretty straightforward install.

@Andrew-Mc-Cormack
Copy link
Contributor

Andrew-Mc-Cormack commented Mar 27, 2019

What version of SilverStripe are you using? And what version of the module?

@aNorthernSoul
Copy link
Author

What version of SilverStripe are you using? And what version of the module?

I figured it out. I had to downgrade to 4.2.2@stable in order for it to work properly. Thanks!

@Andrew-Mc-Cormack
Copy link
Contributor

Found the issue with this.

Line 76 of SilverStripe\Versioned\GridFieldArchiveAction

$isModelVersioned = $model::has_extension(Versioned::class);
if ($isModelVersioned) {
$gridField->getConfig()->removeComponentsByType(GridFieldDeleteAction::class);
}

Absolutely no idea whats the reasoning behind this. The above code will remove unlink action but keep the archive one in the gridfield.
I have a feeling this is only taking into account many_many through relations and not direct many_many ones.

I will do a fix for the module here but this look like a framework bug.

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

No branches or pull requests

2 participants