Comments (5)
I'm having the same issue. Upgraded this morning.
My error message is
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'title' cannot be null (Connection: mysql, SQL: insert into `static_pages` (`name`, `title`, `type`, `attributes`, `created_at`, `updated_at`) values (pages.home, ?, route, {\"nova_page_title\":\"Home\",\"nova_page_created_at\":\"2023-08-15T16:02:09.000Z\",\"seo_description\":\"test\",\"header_text\":\"test\",\"header_description\":\"test\"}, 2023-08-15 15:03:25, 2023-08-15 15:03:25))
Checking through the source I can see that title is now nullable which is wasn't to begin with.
Schema::create('static_pages', function (Blueprint $table) {
$table->increments('id');
$table->string('type');
$table->string('name');
$table->string('title')->nullable();
$table->json('attributes');
$table->timestamps();
});
Looking at the request tab nova_page_title
and nova_page_created_at
are now stored in the attributes
column.
Was there a migration guide between versions that I missed out on?
TIA
from nova-page.
Running into this issues as well, it looks like the title does get saved as an attribute just fine but it won't display in the admin or when using Page::title()
or @get('title')
in blade templates.
Even though the title gets saved as nova_page_title
doing something like @get('nova_page_title')
doesn't work either.
from nova-page.
Same issue here. The title attribute does not get populated on the index/edit/detail views within Nova also. Any chance on getting this fixed? I will need to either downgrade or fork this as we will soon be using this in production.
from nova-page.
If this helps anyone.. I resolved this (temporarily) by using an observer on the page model that updates the model with the title attribute.
if ($novaPageTitle = request('nova_page_title')) { $page->updateQuietly(['title' => $novaPageTitle]); }
from nova-page.
Workaround by overriding the Template and two methods
<?php
namespace App\Nova\NovaPages\Templates;
use Whitecube\NovaPage\Pages\Template as TemplateWhiteCube;
abstract class Template extends TemplateWhiteCube
{
public function getTitle($default = null, $prepend = '', $append = ''): string
{
$this->title = $this->attributes['nova_page_title'];
return parent::getTitle($default, $prepend, $append);
}
public function fill(array $data = []): void
{
if (empty($data['title'])) {
$data['title'] = $data['attributes']['nova_page_title'];
}
parent::fill($data);
}
}
from nova-page.
Related Issues (20)
- Class "Route" not found
- Class "App" Not Found
- Method App\\Nova\\Templates\\Formations::forceFill does not exist HOT 4
- Using with Ebess\AdvancedNovaMediaLibrary
- use the laravel new lang folder path instead of the old one
- Compatibility with Laravel 11
- Page Resource Search does not work
- FR: Hide options from sidebar HOT 2
- Ability to hide nova-option HOT 1
- Detail view broken HOT 7
- Cast Date Field HOT 3
- PHP 8 Compatibility? -- Required parameter follows optional parameter HOT 2
- Remove template declaration in routes HOT 3
- Arabic encoding
- Nova 4 Support HOT 6
- TypeError: Cannot read properties of undefined (reading 'resource') HOT 3
- Error deleting a file HOT 1
- Call to undefined method Whitecube\NovaPage\Pages\Query::exists() HOT 3
- Can this be used for multiple page layouts? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nova-page.