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

500 on saving block settings #102

Open
mattaebersold opened this issue Oct 15, 2020 · 13 comments
Open

500 on saving block settings #102

mattaebersold opened this issue Oct 15, 2020 · 13 comments
Labels
Bug Report Something isn't working

Comments

@mattaebersold
Copy link

I'm trying to save tabs, but after the first successful save, it's throwing a 500 on /index.php?p=admin/actions/spoon/block-types/save every time I try to make any change now, even when backing out, and getting into the spoon settings again

Craft: 3.5.13
Spoon: 3.6.0

image
image

Looks like it's trying to POST to /block-types/save every time I try to either:

  • rearrange the blocks within the tabs and save
  • before opening each block's settings
@joshangell
Copy link
Contributor

Hey, thanks for reporting this @mattaebersold - could you send me the response output from your console as well? Or the Craft error log output - either is fine.

@mattaebersold
Copy link
Author

mattaebersold commented Oct 16, 2020

@joshangell

Failed to load resource: the server responded with a status of 500 () / /index.php?p=admin/actions/spoon/block-types/save:1

The only place I see spoon in the logs is listed in HTTP_X_REGISTERED_ASSET_BUNDLES

And a pretty generic response:
image

@mattaebersold
Copy link
Author

Also, I tried dumping the yaml files in config like mentioned in the ticket about upgrading from 3.4.x to 3.5.x (since we did do that upgrade when the new 3.6.0 of spoon was released)

@joshangell
Copy link
Contributor

joshangell commented Oct 16, 2020 via email

@harrymee123
Copy link

Hi @joshangell ,

I'm also getting the above issue when trying to save or click on the edit/cog for a component within a matrix.

The error I'm getting from the save request is:

Trying to access array offset on value of type null.

I was already on Craft 3.5 before I upgraded to Spoon 3.6.

Cheers,
Harry

@mattaebersold
Copy link
Author

Update here, and a possible line on a new issue (don't know if it's related)

  • I updated to spoon 3.6 and cleared the spoonBlockTypes from the config
  • I re-set spoon configs, tabs, etc. Things seem v. stable now... but
  • a couple members of our team reported that they cannot see the tabs for blocks, just defaults to Craft's one big list. However, tabs within a block are showing up fine.
  • people who've reported it have no console issues
  • screenshot attached for reference

Everyone can see the tabs within blocks
image

A few folks cannot see these tabs. Rather, it's Craft's default one list of 'blocks'. No console errors. I cannot reproduce myself
image

@joshangell
Copy link
Contributor

joshangell commented Oct 31, 2020 via email

@john-henry
Copy link

john-henry commented Dec 15, 2020

We are getting the same error

{"error":"Argument 2 passed to craft\\helpers\\Db::idByUid() must be of the type string, null given, called in /app/vendor/angellco/spoon/src/services/BlockTypes.php on line 292"}l

We upgraded to Craft 3.5 and Spoon 3.6 at the same time. Seemed to be no migration issue when it was done but now running into this

@joshangell
Copy link
Contributor

Anyone still getting this issue? I can’t reproduce it yet but if you are please do send me as much detail as you can and I will try my best to reproduce it ...

@joshangell joshangell added the Bug Report Something isn't working label Feb 9, 2021
@joshangell joshangell self-assigned this Feb 9, 2021
@michaelroper
Copy link

@joshangell yeah, i often get error 500 issues trying to do most things within Spoon settings. Sometimes i just have to wait a bit longer and try again, sometimes i have to go completely out of the page and come back, and sometimes it just works... really slowly.

Same error in the logs as some of the above:
Trying to access array offset on value of type null in /app/vendor/angellco/spoon/src/services/BlockTypes.php:292

@tigerchick
Copy link

I just came across this for the first time after updating to Craft 3.7.18.2 (from a previous version of Craft 3.7)
Doing anything in the Spoon settings UI results in a 500 server error:

error: "Argument 2 passed to craft\\helpers\\Db::idByUid() must be of the type string, null given, called in ../vendor/angellco/spoon/src/services/BlockTypes.php on line 292"
exception: "TypeError"
file: "../vendor/craftcms/cms/src/helpers/Db.php"
line: 909

@tigerchick
Copy link

Further to my previous comment...
Resaving the field Craft's own Field Settings interface seems to clear the error (do that and then go back to Spoon settings and it works correctly again)

@johnfoland
Copy link

I can confirm that this is still a bug on a license of Spoon purchased and installed today, with Craft and the Spoon plug-in being both fully up to date. I can only save/edit/delete my work in Spoon about one in every five times, and that's only if I use the hack proposed by @tigerchick in the previous comment. It also wreaks havoc on my project config, somehow refreshing its config YAML whenever I change something else in the back office.

yii\base\ErrorException: Trying to access array offset on value of type null
  File "/usr/share/nginx/vendor/angellco/spoon/src/services/BlockTypes.php", line 292, in handleError
    $fieldId = Db::idByUid(Table::FIELDS, $data['field']);
  File "/usr/share/nginx/vendor/craftcms/cms/src/web/ErrorHandler.php", line 84, in handleError
    return parent::handleError($code, $message, $file, $line);
  File "/usr/share/nginx/vendor/angellco/spoon/src/services/BlockTypes.php", line 292, in handleChangedBlockType
    $fieldId = Db::idByUid(Table::FIELDS, $data['field']);
  File "/usr/share/nginx/vendor/craftcms/cms/src/services/ProjectConfig.php", line 1189, in handleChangeEvent
    $handler($event);
  File "/usr/share/nginx/vendor/craftcms/cms/src/services/ProjectConfig.php", line 0, in call_user_func
    craft\services\ProjectConfig->handleChangeEvent
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants