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

Clicking "Edit" button in Entries context dropdown menu throws Javascript error and does not redirect #9963

Closed
dniccum opened this issue Apr 26, 2024 · 12 comments

Comments

@dniccum
Copy link

dniccum commented Apr 26, 2024

Bug description

When attempting to edit a Collection entry that is referenced within another entry by utilizing the Entries field type (see screenshot), the contextual menu will appear correctly but the edit button does not redirect the user to the entry nor does it show a popover/modal.

CleanShot 2024-04-26 at 11 26 03

How to reproduce

  1. Create a fieldset that contains an entries field that references an existing collection (FAQ's). The entries field should have the following configuration:
    • Max items: 20
    • UI Mode: Stack Selector
    • Allow Creating: True
  2. Include this fieldset within a collection blueprint (ie Page).
  3. This same blueprint (from step 2) should also include another entries input that references the same collection from Step 1's collection; ie Featured Post
  4. Ensure that a series of entries existing within the FAQ's collection
  5. Create a new entry within the Pages collection. As part of the new entry, reference 5 or 6 of the entries from the FAQ collection. Save when complete.
  6. Re-open the newly created entry in the Edit view.
  7. Within the entries field, attempt to edit one of the entries by utilizing the ... context dropdown menu. When clicking the Edit button, nothing happens. If you open the Javascript Developer Console, you should see an error similar to what I shared.

Logs

TypeError: Cannot read properties of undefined (reading 'id')
    at app-dc40c5f2.js:212:6775
    at Array.find (<anonymous>)
    at q.edit (app-dc40c5f2.js:212:6752)
    at invokeWithErrorHandling (app-dc40c5f2.js:5:37633)
    at q.I (app-dc40c5f2.js:5:14221)
    at invokeWithErrorHandling (app-dc40c5f2.js:5:37633)
    at M.$emit (app-dc40c5f2.js:5:28219)
    at q.selectAndClose (app-dc40c5f2.js:208:260466)
    at invokeWithErrorHandling (app-dc40c5f2.js:5:37633)
    at HTMLAnchorElement.I (app-dc40c5f2.js:5:14221)

Environment

Environment
Application Name: Schier Products
Laravel Version: 10.48.9
PHP Version: 8.2.14
Composer Version: 2.7.4
Environment: production
Debug Mode: OFF
URL: schierproducts.com
Maintenance Mode: OFF

Cache
Config: CACHED
Events: CACHED
Routes: CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: redis
Database: mysql
Logs: stack / single, flare
Mail: mailgun
Queue: sync
Session: redis

Statamic
Addons: 5
Antlers: regex
Sites: 1
Stache Watcher: Disabled
Static Caching: full
Version: 4.57.2 PRO

Statamic Addons
aerni/font-awesome: 2.0.0
aryehraber/statamic-logbook: 3.2.0
joetannenbaum/antlers-stack-tags: 0.1.0
rias/statamic-redirect: 3.6.2
webographen/statamic-admin-log: 1.0.8

Installation

Starter Kit using via CLI

Antlers Parser

Regex (legacy)

Additional details

No response

@duncanmcclean
Copy link
Member

Within the entries field, attempt to edit one of the entries by utilizing the ... context dropdown menu. When clicking the Edit button, nothing happens. If you open the Javascript Developer Console, you should see an error similar to what I shared.

Out of interest, if you just click on the title of the entry, rather then via the dropdown, do you see the same error?

@dniccum
Copy link
Author

dniccum commented Apr 30, 2024

Within the entries field, attempt to edit one of the entries by utilizing the ... context dropdown menu. When clicking the Edit button, nothing happens. If you open the Javascript Developer Console, you should see an error similar to what I shared.

Out of interest, if you just click on the title of the entry, rather then via the dropdown, do you see the same error?

Yes, it appears that is erroring as well.

@duncanmcclean
Copy link
Member

Thanks for checking! It's probably related to my changes in #9841.

I've tried to reproduce this myself but I must be missing something... would you be able to either create a fresh site where it's easy to reproduce the issue or share access to your repo?

@dniccum
Copy link
Author

dniccum commented May 1, 2024

@duncanmcclean you have been added as a collaborator

@duncanmcclean
Copy link
Member

duncanmcclean commented May 1, 2024

Thanks!

Although... weirdly, I'm still not able to reproduce it after updating to the latest version. Is it happening on all entry fields for you or just some of them? Which entry is the screenshot you provided taken on?

@dniccum
Copy link
Author

dniccum commented May 2, 2024

Yes this appears to be happening on multiple entry fields. The URL for the entry that I referenced in the screenshots is: /cp/collections/pages/entries/8825bcf9-eb65-4b43-aa5f-51ccc5790100

I have attached a GIF for what I am seeing:

CleanShot 2024-05-02 at 10 22 16

@shnizmuffin
Copy link

I am getting a similar error, same bit of UX (attempting to edit a related entry):

image

@duncanmcclean
Copy link
Member

@dniccum Can you try uninstalling the aerni/font-awesome addon and let me know if that helps? If I remove it (which I did originally), the error goes away. Might be related to that addon.

@shnizmuffin That seems like a different issue, even if it's happening at the same time. I can't seem to reproduce that issue myself - are you able to share access to your site so we can dig deeper?

@shnizmuffin
Copy link

@duncanmcclean I thought the same thing, but I also have the aerni/font-awesome plugin installed and disabling it made the error go away.

@duncanmcclean
Copy link
Member

Okay, cool! It might be worth opening an issue on the addon's repository in that case.

@shnizmuffin
Copy link

Hey, @dniccum, I opened a ticket over here where @aerni needs a sample project to work from. I can't spin up a fresh install immediately, but it looks like you have something up already?

@shnizmuffin
Copy link

Hey @dniccum, @duncanmcclean, and @aerni -- this issue resolved itself after upgrading to 4.58.1.

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

No branches or pull requests

3 participants