eloquent-driver
eloquent-driver copied to clipboard
Uri field not saved on first save when Orderable is true and max depth is 1
When i have a collection that has Orderable true and has a max depth of 1 the entry URI field is only filled on the second save.
How to reproduce
- Create a collection
- Configure the collection
- Allow Orderable and set max depth on 1
- Use /{mount}/{slug} for uri creation
- Set a mount
- Create an entry in the collection
- Entry is created but URI is empty
- Open the entry and save again and URI is filled
Can you share the full output from php please support:details please?
Environment
Application Name: Statamic
Laravel Version: 10.34.2
PHP Version: 8.2.9
Composer Version: 2.6.4
Environment: production
Debug Mode: OFF
URL: site.ddev.site
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file
Localization
Installed: en, nl
LaravelLang\Lang\Plugin: 12.24.2
Protected Locales: en, nl
Publisher Version: 14.7.1
Statamic
Addons: 2
Antlers: runtime
Stache Watcher: Enabled
Static Caching: half
Version: 4.38.0 PRO
Statamic Addons
mitydigital/sitemapamic: 2.3.8
statamic/eloquent-driver: 2.10.0
Statamic Eloquent Driver
Asset Containers: file
Assets: file
Blueprints: file
Collection Trees: file
Collections: file
Entries: eloquent
Forms: eloquent
Global Sets: eloquent
Global Variables: file
Navigation Trees: file
Navigations: eloquent
Revisions: eloquent
Taxonomies: eloquent
Terms: eloquent
Thanks. I can confirm it does seem to require two saves for the entry URI to be updated in this configuration. I think it will require some changes in core to make this work. I'll update you here with progress.
Any update on the progress?
Not as yet, no.
We are experiencing the exact same issue.
We are also experiencing this bug, when importing entries into the DB from flat files it only updates the uri field when manually saving the entry after the import.
I had the same issue and ended up here. I have to tell my clients to save their pages twice to have the URI field update. It's not great. I hope the PR will be merged quickly.
@clementmas we are working on a solution.