Skip to content

fix: pollora:status reports the slug the attribute registers - #375

Merged
ogorzalka merged 1 commit into
developfrom
fix/status-attribute-slug
Sep 30, 2026
Merged

ogorzalka merged 1 commit into
developfrom
fix/status-attribute-slug

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Closes #298.

Problem

SystemInfoCollector (behind pollora:status and the dashboard) derived each post type and taxonomy slug from the class name (kebab(class_basename)), ignoring #[PostType('…')] / #[Taxonomy('…')]. It also skipped the 20-character cut discovery applies to a derived slug, and ignored the attribute's plural label.

Change

  • The slug rule lives on the attributes: PostType::resolveSlug($className) and Taxonomy::resolveSlug($className) — explicit slug, else kebab-case of the class name cut to 20 characters.
  • PostTypeDiscovery / TaxonomyDiscovery register with it (their private generateSlug() copies are gone).
  • The collector reads the attribute by reflection and uses the same method; label falls back to the attribute's plural before the class name.

Tests

  • resolveSlug() for both attributes (explicit, derived, 20-char cut).
  • Collector test with the exact class from the issue (#[PostType('synthese-presse', …)] class SyntheseDePresse) — fails on the old code (synthese-de-presse).
  • On a real site (pollora-test): pollora:status lists test_case for #[PostType('test_case')] class TestCase — matching wp post-type list — where the old code showed test-case.
  • Full suite 1372 green, PHPStan 0, Rector clean.

Closes #298. The slug rule moves to PostType::resolveSlug() and Taxonomy::resolveSlug(),
used by discovery and by the status collector alike.
@ogorzalka
ogorzalka merged commit 8375428 into develop Sep 30, 2026
11 checks passed
@ogorzalka
ogorzalka deleted the fix/status-attribute-slug branch September 30, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant