A module to store and display simple and lightweight contents
silverbusters / silverstripe-simplelistfield Goto Github PK
View Code? Open in Web Editor NEWA module to store and display simple and lightweight contents
License: MIT License
A module to store and display simple and lightweight contents
License: MIT License
We've run into an issue on several sites that use this module with the Simline template portfolio system when trying to edit Portfolio Items. The following warning appears:
[Warning] Invalid argument supplied for foreach()
/container/application/public/silverstripe-simplelistfield/forms/SimpleListField/SimpleListField.php:144
We are then unable to edit or save any changes to the Portfolio Item.
The problem is in the preloadScenarios function in SimpleListField.php and it appears that the variable $scenarios is not coming through as an array.
public static function preloadScenarios(){
if(self::$preloaded_scenario === false){
self::$preloaded_scenario = true;
$scenarios = Config::inst()->get('SimpleListField', 'Scenarios');
foreach($scenarios as $key => $val){
if( isset($val['preload']) && $val['preload'] ){
self::$scenarios[$key] = $val;
}
}
}
}
There doesn't seem to be any need to preload Scenarios for the module to work so we've been able to get around it by simply commenting out line 20 of SimpleListField.php so the function is not called. However this isn't exactly a fix.
My guess is that the scenarios for preload should be defined in a config file somewhere but there are no instructions on how to do this that I can see.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.