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

Error upon saving in Craft 2.6.3009 #92

Closed
tigerchick opened this issue Feb 20, 2018 · 6 comments
Closed

Error upon saving in Craft 2.6.3009 #92

tigerchick opened this issue Feb 20, 2018 · 6 comments

Comments

@tigerchick
Copy link

tigerchick commented Feb 20, 2018

Description

When saving an entry with a Simplemap field (in Matrix - untested outside of a Matrix), the following error is given:
Internal Server Error
array_key_exists() expects parameter 2 to be array, null given

Steps to reproduce

  1. Update to latest Simplemap version 1.8.2
  2. Update to latest Craft 2 version - 2.6.3009
  3. Save entry with simplemap field

Additional info

  • Craft version: 2.6.3009
  • SimpleMap version: 1.8.2
  • PHP version: 7.0.27
@taylordaughtry
Copy link

taylordaughtry commented Feb 21, 2018

I'm seeing this as well on Craft 2.6.2988 with SimpleMap version 1.8.2, with the SimpleMap field outside any Matrix field; simply the usual field on an entry.

Digging in, it looks like the $data value being provided from the SimpleMap_MapFieldType content is null when it's being saved, which is why it's throwing an error. I haven't looked into it enough to know exactly why that is. The field has content.

EDIT: Found the issue. The ContentModel fetches the column data for the entry—but Simple Map doesn't use that column; it has a separate table. So when that content is checked, it's null, which is throwing the error. PR is submitted here.

@tigerchick
Copy link
Author

That's brilliant Taylor - thank you for looking into this. Hopefully your solution will be merged quickly.

Tam added a commit that referenced this issue Mar 2, 2018
Tam added a commit that referenced this issue Mar 5, 2018
@Tam Tam closed this as completed Mar 5, 2018
@AdamVig
Copy link

AdamVig commented Apr 8, 2018

@Tam I am experiencing this same problem on SimpleMap version 3.3.3 with Craft 3.0.1. Can you merge the fix into the v3 branch as well?

@jannisborgers
Copy link

I’m still receiving the same error with SimpleMap 3.3.3 and Craft 3.0.2.

@Tam
Copy link
Member

Tam commented Apr 16, 2018

@AdamVig @jannisborgers I've just tested saving a map in a matrix and was unable to re-create this error. If this is still an issue, could you open a new issue and include the error message you are seeing?

@AdamVig
Copy link

AdamVig commented Apr 18, 2018

@Tam Thanks for your reply. The plugin is now working for me.

It looks like a recent Craft update fixed it, because that is the only thing that has changed since I originally commented.

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

5 participants