bacbos / bolt-menu-editor

a visual menu-editor extension for the awesome bolt cms
Other
21 stars 23 forks source link

Fix issues with ContentTypes that don't have icons #49

Closed SvanteRichter closed 7 years ago

SvanteRichter commented 7 years ago

When a ContentType didn't have icons we'd HTTP 500 on the search route. This fixes that.

ping @navelpluisje for πŸ‘ πŸ‘Ž

navelpluisje commented 7 years ago

How can I reproduce the HTTP 500?

SvanteRichter commented 7 years ago

@navelpluisje: Install a fresh bolt install, prefill the db with some example records and go to the menueditor to search for content. The ajax call will show a 500 error that should be fixed by this PR.

navelpluisje commented 7 years ago

Weird, on a fresh install I already get an empty string on master if there is no icon and am not getting a 500. Can it depend on the system we test on? I use a macbook running MAMP. .

SvanteRichter commented 7 years ago

Are you using a archive or a composer install? Archive install have a lower debug threshold per default IIRC.

navelpluisje commented 7 years ago

The archive install, but turned off debugging in the config

SvanteRichter commented 7 years ago

Try setting the debug settings to

debug: true
debug_show_loggedoff: false
debug_permission_audit_mode: false
debug_error_level: -1               # equivalent to E_ALL
debug_error_use_symfony: false      # When set to true, Symfony Profiler will be used for exception display when possible

That's the defaults in the composer install.

navelpluisje commented 7 years ago

That's also the default for the archive. Changed the debug back to true with no result. What PHP version are you running? I'm running on 7.0.0

SvanteRichter commented 7 years ago

Odd... I'm on 7.0.9 (but on a centos VPS) with bolt 3.2.6. Are you using the default contenttypes? In that the pages and entries have no defined icons?

SvanteRichter commented 7 years ago

Perhaps local extensions get a stricter debug mode? I'm running the menueditor as a local ext since I was also checking out your PR.

navelpluisje commented 7 years ago

Just did a fresh & new install and added just the dummy data. Checked the contenttypes and both the entries and pages do not have icons set

navelpluisje commented 7 years ago

Same here on the local extension

navelpluisje commented 7 years ago

didi the issue occur on my PR or master?

SvanteRichter commented 7 years ago

It was on your PR, but since you didn't change the PHP file at all, and the search route doesn't hit any files that you changed it shouldn't make a difference.

navelpluisje commented 7 years ago

Sounds fair enough, but I will check this with my PR first;-) 'Cause I'm checking on master

SvanteRichter commented 7 years ago

Just checked out master from here and get the error there too:

image

Also tried deleting the local extension and installing latest stable from the bolt backend and get the same:

image

Either something is off on my end or on yours πŸ˜†

navelpluisje commented 7 years ago

screen shot 2017-01-25 at 22 47 18

I think it's yours 😝

SvanteRichter commented 7 years ago

Label added and I'll ask the other bolt folks when they are around if they have any clue as to why we'd be seeing so different behavior :)

navelpluisje commented 7 years ago

Ok. Must almost be something system-wise I think. But assumptions are the mo.......

Will fix the other PR tomorrow. Had a short night and hard day. Need some sleep.

navelpluisje commented 7 years ago

My macbook from work did throw the errors we were looking for. Did find 2 more;-) Also MAMP. But on both PHP 7.0.8 as 5.6.10 do throw errors. Sadly to see I have to fix something over there😑