Skip to content

Commit 5e32121

Browse files
committed
Merge branch '4.x' into 5.x
2 parents 3093b47 + eab985b commit 5e32121

2 files changed

Lines changed: 52 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
All notable changes to `inspirecms-core` will be documented in this file.
44

5+
## 4.0.7 - 2026-03-27
6+
7+
### What's Changed in 4.0.7
8+
9+
#### 🐛 Bug fixes
10+
11+
- Fix: 'slug' & 'meta title' not update after content's title changes (904d362)
12+
- Bug Fix - Invalidate Document Type While Createing Content (8c45718)
13+
14+
#### 🔧 Other Changes
15+
16+
- Merge remote-tracking branch 'origin/HEAD' into 4.x (da7df0f)
17+
- Hotfix: 'Publish' action no effect (39ffaa1)
18+
19+
### Installation
20+
21+
**Full Changelog**: https://github.com/solutionforest/Inspirecms-core/compare/4.0.6...4.0.7
22+
523
## 4.0.6 - 2026-03-27
624

725
<!-- Release notes generated using configuration in .github/release.yml at 4.x -->
@@ -103,6 +121,7 @@ composer require solution-forest/inspirecms-core:^1.2.2
103121

104122

105123

124+
106125
```
107126
## 1.2.1 - 2025-08-19
108127

@@ -125,6 +144,7 @@ composer require solution-forest/inspirecms-core:^1.2.1
125144

126145

127146

147+
128148
```
129149
## 1.2.0 - 2025-08-13
130150

@@ -158,6 +178,7 @@ composer require solution-forest/inspirecms-core:^1.2.0
158178

159179

160180

181+
161182
```
162183
## 1.1.3 - 2025-08-12
163184

@@ -187,6 +208,7 @@ composer require solution-forest/inspirecms-core:^1.1.2
187208

188209

189210

211+
190212
```
191213
**Full Changelog**: https://github.com/solutionforest/Inspirecms-core/compare/1.1.1...1.1.2
192214

src/Base/Filament/Concerns/ContentFormTrait.php

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,31 @@
2828

2929
use function Filament\Support\is_app_url;
3030

31+
/**
32+
* Marker trait — enables Filament's cacheTraitActions() to call
33+
* cacheHasContentFormActions() before cacheMountedActions() runs,
34+
* so extra status actions are in cachedActions in time.
35+
*/
36+
trait HasContentFormActions {}
37+
3138
trait ContentFormTrait
3239
{
40+
use HasContentFormActions;
41+
3342
protected ?string $publishOperation = null;
3443

44+
/**
45+
* Called by Filament's cacheTraitActions() during bootedInteractsWithActions(),
46+
* BEFORE cacheMountedActions() resolves the mounted action. This ensures the
47+
* extra status form actions are in cachedActions in time for resolution.
48+
*/
49+
public function cacheHasContentFormActions(): void
50+
{
51+
foreach (inspirecms_content_statuses()->getFormActions() as $action) {
52+
$this->cacheAction($action);
53+
}
54+
}
55+
3556
public function bootedContentFormTrait(): void
3657
{
3758
$mainActions = [
@@ -537,7 +558,7 @@ protected function wrapPublisableSavingEventIntoDbTransaction(Closure $callback)
537558

538559
// region Actions
539560

540-
protected function publishAction()
561+
protected function publishAction(): Action
541562
{
542563
return Action::make('publish')
543564
->label(__('inspirecms::buttons.publish.label'))
@@ -548,21 +569,22 @@ protected function publishAction()
548569
->color('primary')
549570
->button()
550571
->schema(fn (Schema $schema) => PublishContentForm::configure($schema))
551-
->beforeFormValidated(function () {
572+
->fillForm(fn () => ['published_at' => now()])
573+
->beforeFormFilled(function (Action $action) {
552574
try {
553-
554575
$this->validatePublishableData();
555-
556-
} catch (Throwable $e) {
576+
} catch (ValidationException $e) {
557577
Notification::make()
558578
->title(__('inspirecms::notification.form_check_error.title'))
559579
->danger()
560580
->send();
561581

562-
throw $e;
582+
$action->halt();
563583
}
564584
})
565-
->action(fn ($data, $action) => $this->publish($data, $action))
585+
->action(function (array $data, Action $action) {
586+
$this->publish($data, $action);
587+
})
566588
->model(InspireCmsConfig::getContentModelClass())
567589
->authorize('publish')
568590
// Cannot publish if the parent is not published
@@ -584,7 +606,7 @@ protected function publishAction()
584606
});
585607
}
586608

587-
protected function publishDescendantsAndSelfAction()
609+
protected function publishDescendantsAndSelfAction(): Action
588610
{
589611
return $this->publishAction()
590612
->name('publishDescendantsAndSelf')

0 commit comments

Comments
 (0)