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

Erroring with elemental-userforms #80

Closed
dizzystuff opened this issue May 23, 2023 · 0 comments · Fixed by #81
Closed

Erroring with elemental-userforms #80

dizzystuff opened this issue May 23, 2023 · 0 comments · Fixed by #81

Comments

@dizzystuff
Copy link
Contributor

dizzystuff commented May 23, 2023

Apologies in advance, I don't have the specific scenario that caused the error, but I do have the simple fix! While doing SS5 upgrades and reviews, I'm PR'ing back what I can as I go.

Basically updateCMSFields in UserFormUseQueuedExportExtension.php is expecting $gridField = $fields->fieldByName('Root.Submissions.Submissions'); to always return a valid gridfield.

When I use this module along with elemental-userforms, in some scenario (which I can't recall - but I think is as commonplace as on creation of the userforms element) the Root.Submissions.Submissions gridfield doesn't exist, so when $gridField->getConfig() is called on null, an error is thrown.

I'm going to submit a PR, ideally could we just add if (empty($gridField)) return; between the two lines?

I can do more homework here, I'm just hoping that it's enough of a commonsense edit that you don't need me to 😅

PRs

dizzystuff added a commit to fromholdio/silverstripe-gridfieldqueuedexport that referenced this issue May 23, 2023
GuySartorelli added a commit that referenced this issue Jun 8, 2023
FIX #80 check $gridField exists before calling getConfig()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants