Can not create a wishlist

Created on 29 May 2023, over 1 year ago
Updated 1 June 2023, over 1 year ago

Problem/Motivation

Hello,
I can not create a wishlist. Clicking on the "Add wishlist" ajax link does nothing but an AJAX error:

"
An AJAX HTTP error occurred.
HTTP Result Code: 404
Debugging information follows.
Path: /wishlist/wishlist/add
StatusText: error
ResponseText: {"message":"The \u0022better_wishlist_type\u0022 parameter was not converted for the path \u0022\/wishlist\/{better_wishlist_type}\/add\u0022 (route name: \u0022entity.better_wishlist.add_form\u0022)"}"

Steps to reproduce

Installed the module with composer
Changed the field storage settings of the Wishlisted entity field to:

Reference method:Better wishlist items
and selected "Content" checkbox

The behavior of this form is funky. Once I selected Reference method "Default" now I cant.
And the add to wishlist widget appears on any content. Shouldn't I select which bundle exactly?
Am I missing something with the configuration?

I see the error appears to be connected with the "better_wishlist_type"

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇧🇬Bulgaria alexander.nachev

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @alexander.nachev
  • 🇧🇬Bulgaria alexander.nachev

    Reading about other errors in google for "parameter was not converted" I finnaly understood that the wishlist type i am sending with the ajax call is somehow wrong. The widget sends as second parameter "wishlist" and I named the wishlist type "Favourites" so the machine name is different and it seems to be hardcoded in the AJAX widget. Some one with more skill than me can say...

    Solution was just to rename my wishlist type to wishlist.

    My next problem was to be able to create wishlists as anonymous user. I set the permissions for the anon user and voalia the widget allowed me to create wishlists with the session ID and these wishlists stayed. Really cool.

    I was not able to add items to the wishlists I create as anon user and getting 403 ajax error telling me "update own better wishlist permission is required"

    And I tried giving the anon user every permission the module has created without making any difference.

    Without much thinking I found the better_wishlist_widget.routing.yml file and changed:
    _permission: 'update own better wishlist'
    to:
    _permission: 'access content'

    hahhah come hackers you are welcome :)

    And it works.
    Definetly very ugly solution but I will leave it like this untill I learn more on D9 or someone fixes this.

  • 🇩🇪Germany sch4lly

    Thanks for the report! I'll have a look into this.

Production build 0.71.5 2024