Comments (6)
I was unable to reproduce the issue with my nova. Could you provide more information/reproducible code example so we can take another look at this issue.
from nova-page-manager.
In one of my Templates, I had a static function regions()
which simply called nova_get_regions()
and returned that as an associative array. Then in my Field definitions I was trying to use some of the data from that (some colors set in a different region), to prefill the palette of a Color field.
from nova-page-manager.
$regions = nova_get_regions();
$titles = collect($regions)->pluck('data')->pluck('et.title')->filter();
return [
Select::make('Titles')->options($titles),
]
I tried to reproduce the issue with code above but was unable to.
Could be an issue with the colour field/invalid data.
Closing this at the moment since i can't find a reason how this could be regions/page-manager issue.
from nova-page-manager.
It didn't matter if I actually implemented the retrieved values into the Color Field (or any other field). The mere presence of the nova_get_regions()
in my Template was enough to crash the app.
I was actually caching the response of nova_get_regions()
using Laravels Cache
helper? Could that be the source of the issue?
Heres a rough example
class AppController extends Controller
{
public static function regions()
{
return Cache::remember('regions', 60, function(){
return nova_get_regions();
});
}
My Template
class Shortlist extends Template
{
public static $type = 'region';
public static $name = 'Shortlist';
public function fields(Request $request): array
{
$regions = AppController::regions();
return [ ...
Even if I do nothing with $regions
, just having the call to nova_get_regions()
in the static function in AppController
is enough to break it
from nova-page-manager.
My bad, this seems to be the problem indeed when calling nova_get_regions inside region template.
I was testing this inside a page template, which was the reason why i wasn't able to reproduce.
from nova-page-manager.
No worries. Right now Im getting around it by just using the Region::all()
method to get all the regions data, that doesn't crash anything, though the data is formatted a bit differently than it would be from nova_get_regions()
from nova-page-manager.
Related Issues (20)
- Not working with ebess/advanced-nova-media-library HOT 3
- Error after migrating from Nova 3 to 4 HOT 1
- Struggling with getRegions and formatRegion helpers HOT 1
- Panels dont have any impact on `data` JSON now? HOT 5
- Depends on Laravel 9, but that dependency is not specified in composer.json HOT 1
- Error: Undefined array key "__" HOT 1
- Indirect modification of overloaded element of Outl1ne\PageManager\Models\Region has no effect HOT 4
- DateTime field must cast to 'datetime' in Eloquent model. HOT 4
- 'page_seo_fields' => true does not show panel when editing page HOT 1
- Issues with Octane: 404 on /resources/pages HOT 1
- Deleting SEO images, unexpected behavior HOT 1
- Works with Nova 4.22, breaks with Nova 4.23 HOT 1
- "Undefined array key \"__\"" On Nova Edit Page HOT 1
- overwriting page_seo_fields with a callable that returns an array of fields gives error on config caching HOT 1
- Image field not updating when inside Nova Flexible Content HOT 2
- Unable to Download Image or File field
- Regions detail not working, 404 on styles and scripts using latest Nova HOT 1
- Language data not being loaded
- "Invalid locale specified (de)" after updating to Nova 4.32.11 HOT 2
- PrefixSlugField has no value HOT 1
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-manager.