Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Automatic slug creation from a title #371

Closed
Ratko-Solaja opened this issue Oct 29, 2024 · 5 comments · Fixed by #372
Closed

Automatic slug creation from a title #371

Ratko-Solaja opened this issue Oct 29, 2024 · 5 comments · Fixed by #372
Assignees

Comments

@Ratko-Solaja
Copy link

Bug description

When you install Statamic but use a DB driver. When creating new entries or new taxonomies (anywhere you need a slug that will get generated automatically) it doesn't work.

The problem is that you need to define a locale in Site Settings and only afterwards it will work. If not, axios returns an error in which it clearly says that the language can't be empty.

How to reproduce

  • Start new Statamic installation.
  • Select any DB driver (I tried SQLite and MySQL).
  • Select to import everything.
  • When done, go to Collections -> Pages -> New Entry and type in the title. Slug field won't be populated.

Logs

No response

Environment

Environment
Application Name: ****
Laravel Version: 11.29.0
PHP Version: 8.3.13
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: ****.test
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: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file

Statamic
Addons: 2
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.35.0 PRO

Statamic Addons
statamic/eloquent-driver: 4.16.0
statamic/importer: 1.0.2

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

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

@fajriyan
Copy link

I got the same problem in a similar environment after doing the latest statamic update.

@jasonvarga
Copy link
Member

Is there a JS error?

@Ratko-Solaja
Copy link
Author

Here are some images...

Screenshot 2024-10-31 at 9 25 24 PM Screenshot 2024-10-31 at 9 25 41 PM Screenshot 2024-10-31 at 9 25 46 PM

@jasonvarga
Copy link
Member

Confirmed, thanks.

Easy workaround though:

  • Click "Site" in the sidebar
  • Enter "en" (or your appropriate language) into the Language field.
  • Save

@jasonvarga jasonvarga transferred this issue from statamic/cms Oct 31, 2024
@jasonvarga
Copy link
Member

The issue is that the site that gets imported into the sites table has an empty lang value.

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

Successfully merging a pull request may close this issue.

5 participants