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

Feedme 5.6.0 update causing array_splice error with Assets #1481

Closed
bliswebagency opened this issue Jul 16, 2024 · 7 comments
Closed

Feedme 5.6.0 update causing array_splice error with Assets #1481

bliswebagency opened this issue Jul 16, 2024 · 7 comments
Assignees
Labels

Comments

@bliswebagency
Copy link

bliswebagency commented Jul 16, 2024

Description

After updating to feedme 5.6.0 from 5.5.0, imports which use Assets are failing with an error:

array_splice(): Argument #1 ($array) must be of type array, null given - Assets.php: 122.

Rolling back to 5.5.0 resolves the issue and we are able to import again.

Steps to reproduce

  1. Import with a json feed and configure feedme to import the images as assets

[
    {
         "defaultImage" : "https:\/\/example.com\/images\/default.jpeg",
         "images": [
            {
                "image": "https:\/\/example.com\/images\/image.jpeg?r=9",
            }   ,
            {
                "image": "https:\/\/example.com\/images\/image-2.jpeg?r=9",
            }   
          ]
    },
    {
         "defaultImage" : "https:\/\/example.com\/images\/default2.jpeg",
         "images": [
            {
                "image": "https:\/\/example.com\/images\/image-3.jpeg?r=9",
            }   ,
            {
                "image": "https:\/\/example.com\/images\/image-4.jpeg?r=9",
            }   
          ]
    }
]
  1. Run import

  2. Check logs, nothing imported in due to error

array_splice(): Argument #1 ($array) must be of type array, null given - Assets.php: 122.
  1. Rollback to 5.5.0 and run above. No errors reported.

Additional info

  • Craft version: 4.10.5
  • PHP version: 8.1.29
  • Database driver & version: MariaDB 10.4.34
  • Plugins & versions:
Breadcrumb 	2.0.0
Cookie Consent Banner 	2.0.1
Embedded Assets 	4.1.0
Feed Me 	5.6.0
Google Maps 	4.5.2
Imager X 	4.4.1
Pitch 	2.4.0
Redactor 	3.1.0
SEOmatic 	4.1.0
Sprig 	2.8.1
Super Table 	3.0.14
Wishlist 	2.0.11
@martyspain
Copy link

I'm experiencing this too in version 6.2.0 on Craft 5. As above, rolling back to the previous release, in this case 6.1.0, resolved the issue.

@lucasdaniels
Copy link

lucasdaniels commented Jul 16, 2024

I found out that you need to have a value in the 'Use this filename for assets created from URL' field (FeedMe 6.2.0).

A workaround for this issue, if you have no image names as a separate field, is by mapping the image URL in the 'Use this filename for assets created from URL' field; you will get odd names though.

@ianshea
Copy link

ianshea commented Jul 16, 2024

@lucasdaniels You can set:

Use this filename for assets created from URL:
Use default value

and it will keep just the filenames

@i-just
Copy link
Contributor

i-just commented Jul 17, 2024

Hi all, thanks for reporting! I raised a PR for this.

@angrybrad
Copy link
Member

Merged and will be included in the next v5 and v6 release!

@angrybrad
Copy link
Member

Feed Me 5.6.1 and 6.2.1 are out with this fix.

@bliswebagency
Copy link
Author

@angrybrad @i-just - thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants