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

Entry slug URI not updating on save #391

Closed
kram-dyoll opened this issue Dec 10, 2024 · 3 comments · Fixed by #392
Closed

Entry slug URI not updating on save #391

kram-dyoll opened this issue Dec 10, 2024 · 3 comments · Fixed by #392
Labels
bug Something isn't working

Comments

@kram-dyoll
Copy link

kram-dyoll commented Dec 10, 2024

Bug description

I'm using the Eloquent driver for entries and it seems to be an issue when using the Eloquent driver as the file based driver works as expected.

When I update the slug for an entry, the change saves but checking the new URL results in a 404 page (old URL is still valid). If I save the page again, the new URL work.

It looks like the first save updates the slug field in the table. The second save then updates the uri field in the table.

How to reproduce

  • Use the Eloquent driver for entries.
  • Update a slug of an entry and visit the new page. This will be a 404 page. You can also check the DB table and see the slug has been updated , but the uri has not.
  • Save the entry again and visit the new page. This will now work as expected. You can also check the DB table and see the uri has now been updated.

Logs

No response

Environment

Environment
Application Name: Test Website
Laravel Version: 11.34.2
PHP Version: 8.3.14
Composer Version: 2.8.3
Environment: local
Debug Mode: ENABLED
URL: test-website.ddev.site
Maintenance Mode: OFF
Timezone: UTC
Locale: en

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

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 2
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.42.0 PRO

Statamic Addons
statamic/eloquent-driver: 4.19.0
statamic/seo-pro: 6.4.0

Statamic Eloquent Driver
Asset Containers: file
Assets: eloquent
Blueprints: file
Collection Trees: eloquent
Collections: file
Entries: eloquent
Forms: eloquent
Global Sets: file
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: file
Revisions: file
Sites: file
Taxonomies: eloquent
Terms: eloquent
Tokens: file

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

@duncanmcclean

This comment was marked as resolved.

@duncanmcclean duncanmcclean added the duplicate This issue or pull request already exists label Dec 10, 2024
@duncanmcclean duncanmcclean transferred this issue from statamic/cms Dec 10, 2024
@duncanmcclean
Copy link
Member

After a second read over, this looks like a different issue. Re-opening.

@duncanmcclean duncanmcclean reopened this Dec 10, 2024
@duncanmcclean duncanmcclean added bug Something isn't working and removed duplicate This issue or pull request already exists labels Dec 10, 2024
@ryanmitchell
Copy link
Contributor

I can replicate the issue.

It works as expected when using eloquent driven collections, but not when using file/stache driven collections. I've got a PR here for the changes required - ended up being a 1 method change.

Do you want to give it a check and see if it works for you? #391

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

Successfully merging a pull request may close this issue.

3 participants