-
Notifications
You must be signed in to change notification settings - Fork 176
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
Conimex import fails when collection is empty #3291
Comments
It's worth noting that this same export also fails in Bolt 5.1.12 on PHP 7.4. (Albeit with a slightly different error message.) So this is not just a PHP 8 issue, as I previously thought.
|
I'm guessing this is a case of an old I can see the |
Nope - this still occurs on the latest |
I still don't know if this is a Conimex bug or a Bolt core bug, but I was able to fix by adding a check for array length in the if (isset($formData['collections'])) {
foreach ($formData['collections'] as $collectionName => $collectionItems) {
if ( !count( $collectionItems ) ) continue; // NEW LINE HERE This prevents line 433 from flipping out (pun!) because https://github.com/bolt/core/blob/master/src/Controller/Backend/ContentEditController.php#L433 Is this a newbie fix, or should I PR this? |
I get a warning
"Warning: Undefined array key "order"
after running a conimex import:I believe this is a new / more strict warning in PHP 8?
https://stackoverflow.com/questions/71025115/dealing-with-php-8-1-warning-for-undefined-array-key
Details
Reproduction
Stack trace:
Steps to reproduce
Evidently, importing a conimex import which does not include the
order
key.Expected result
I expected that my content would import.
Actual result
A failed import, with no ability to skip the warning.
The text was updated successfully, but these errors were encountered: