FixTailorImport is an OctoberCMS 4.x plugin that resolves common issues when importing Tailor entries from JSON and CSV files. It automatically fixes missing identifiers, generates readable URL values from the entry title, and restores proper nested tree data for structure sections.
What it fixes
- assigns an
idwhen it is missing - generates
slugfromtitleinstead of technical values likeslug-abc123... - rebuilds
fullslugautomatically after saving - populates
nest_left,nest_right, andnest_depthfor structure entries - allows CSV rows without an
idcolumn to be created - uses random digits for slug conflict suffixes instead of sequential
-2,-3 - helps repair previously imported broken records
This makes imported Tailor entries immediately usable in real projects, without manual cleanup in the database after import.
Installation via Command Line
php artisan plugin:install DMdev.FixTailorImport
FixTailorImport
FixTailorImport helps keep Tailor imports clean, readable, and structurally correct when importing entries from JSON or CSV.
It is especially useful for structure sections, where imported records need valid IDs, readable URLs, and correct nested tree values immediately after import.
Installation
Copy the plugin to:
plugins/dmdev/fixtailorimport/
Then run:
php artisan october:migrate
Features
- Auto-assigns missing
idvalues - Generates readable
slugvalues fromtitle - Rebuilds
fullslugautomatically after saving - Populates
nest_left,nest_right, andnest_depthfor structure entries - Supports CSV imports even when the
idcolumn is missing - Repairs broken records imported before the plugin was installed
Console Commands
tailor:fix-nulls
Repairs previously imported records that may contain:
- empty or technical
slugvalues - invalid nested tree fields
- empty
fullslugvalues
For structure sections, it rebuilds the tree and restores fullslug across the hierarchy.
php artisan tailor:fix-nulls "Catalog\Category" --dry-run php artisan tailor:fix-nulls "Catalog\Category"
tailor:fix-structure
Applies configured category-to-parent rules and rebuilds the structure tree.
Use --rebuild-only when you only want to rebuild the nesting without applying mapping rules.
php artisan tailor:fix-structure "Catalog\Category" --dry-run php artisan tailor:fix-structure "Catalog\Category" php artisan tailor:fix-structure "Catalog\Category" --rebuild-only
tailor:fix-slugs
Retrospectively replaces technical slug values with readable ones generated from the entry title.
php artisan tailor:fix-slugs --dry-run php artisan tailor:fix-slugs "Catalog\Category" php artisan tailor:fix-slugs
Configuration
Configuration for structure mapping is stored in:
plugins/dmdev/fixtailorimport/config/fixtailorimport.php
Structure Rule Options
| Parameter | Description |
|---|---|
category_field |
Field containing the category value from imported CSV data |
parent_resolve |
Field used to find the parent record |
parent |
Parent record value resolved via parent_resolve; use null for root |
set |
Optional extra attributes to assign during import |
How It Works
The plugin does not modify the OctoberCMS core, modules/*, or vendor/*.
It works through standard OctoberCMS extension points and tree rebuild methods:
- service binding for the import pipeline
EntryRecordextension hooks for slug, nesting, andfullslug- built-in NestedTree rebuild methods for structure sections
-
This plugin has not been reviewed yet.
-
| 1.0.0 |
Initial release Mar 25, 2026 |
|---|