Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
WanWizard
a.k.a. WanWizard
Discussions
4
Comments
8242
Activity
belongs_to cannot find the from key without configuration
It doesn't use the tablename, that is defined in the destination model. It only uses the relation name, so if your relation is "calendarschedule", this will be generated: 'key_from' => 'calendarschedule_id',…
Comment by
WanWizard
April 2018
permalink
belongs_to cannot find the from key without configuration
If one doesn't work, your table structure doesn't conform to the standard, so the ORM can't determine all relation parameters from the relation name. Which is why you have the option to completely configure it.
Comment by
WanWizard
April 2018
permalink
belongs_to cannot find the from key without configuration
It is not optional, there are two ways of defining the relation: 1. as a relation name: protected static $_belongs_to = array('calendaritem'); This way the ORM will use the relation name to determine the rest of the values 2. as a relation…
Comment by
WanWizard
April 2018
permalink
belongs_to cannot find the from key without configuration
Relations always have to be defined both ways. I will not work without, as you have noticed.
Comment by
WanWizard
April 2018
permalink
to_array() shows Warning on belongs_to with null value
I've looked around in the code, everything seem to use empty() to test for the presence of a relation, so that should be ok. Anyway, I've made a further change to return null on singular relations, and array() on plural ones. but I haven…
Comment by
WanWizard
April 2018
permalink
to_array() shows Warning on belongs_to with null value
I don't think that matters, but you might want to test that, the Orm isn't my strongest point.
Comment by
WanWizard
April 2018
permalink
to_array() shows Warning on belongs_to with null value
Hotfix 1.8.1.2 for Orm pushed.
Comment by
WanWizard
April 2018
permalink
to_array() shows Warning on belongs_to with null value
Sjees, does nobody test anymore? This code has been in 1.9/dev for months! :-( It's probably better to change the null test to if (empty($rel)){ $array[$name] = null;} which would capture both.
Comment by
WanWizard
April 2018
permalink
to_array() shows Warning on belongs_to with null value
Thanks for reporting it. Has been fixed, you can use "composer update" to install the fix.
Comment by
WanWizard
April 2018
permalink
Sub-Namespace/Sub-Module Question
People have written books about API and versioning. ;-) The biggest challenge with excplicit versioning is that you have to maintain two or more sets of source. I think currently the best is to either try to keep your API backwards compatible (so av…
Comment by
WanWizard
April 2018
permalink
Sub-Namespace/Sub-Module Question
You have mutliple problems. You have:- /fuel/app/modules/v2/mycore/classes/controller/mytest.php - /fuel/app/modules/v3/mycore/classes/controller/mytest.php You define you have modules at:- /fuel/app/modules- /fuel/app/modules/v2- /fuel/app/modules…
Comment by
WanWizard
April 2018
permalink
Sub-Namespace/Sub-Module Question
The most obvious candidate for that error message is not following the naming rules. You get it when the url resolves to a classname, and the classname resolves to an existing filename, but that file doesn't contain the expected class. It then …
Comment by
WanWizard
April 2018
permalink
DBUtil: Possible to Make SQL Check Constraints?
Indeed, not supported. The big challenge is to find a portable way of implementing them, which isn't easy with low-level stuff like this.
Comment by
WanWizard
April 2018
permalink
Render an asset svg file
Added the required code to the Asset class: https://github.com/fuel/core/commit/cc6096991c0811c75ea46f08a9762a5a4c40739d Tested with: \Asset::add_type('svg', 'assets/svg/', function($file, $attr, $inline) { // return the svg …
Comment by
WanWizard
April 2018
permalink
Render an asset svg file
Yeah, it should be a static method, sorry. I don't see how given the examples the Asset_Instance() object could be returned? And your closure should return HTML, so the output in your initial question, and not a dump of an svg file.
Comment by
WanWizard
April 2018
permalink
Render an asset svg file
No, add it to core/classes/asset.php, that provides the static interface.
Comment by
WanWizard
April 2018
permalink
Render an asset svg file
No, it doesn't have a static interface, as it's created on the instance, not globally. \Asset::instance->svg('logo-inline.svg'); should work. Do you still have your Asset class extension? If so, you could add: /** * Provide a…
Comment by
WanWizard
April 2018
permalink
Render an asset svg file
That works too.
Comment by
WanWizard
April 2018
permalink
Render an asset svg file
Asset::instance()->add_type('svg', $rootpath-to-your-asset, function($images, $attr, $inline) { // your code to render the asset goes here... }); You could have a look at the Asset_Instance class, render_img(), to see how that is don…
Comment by
WanWizard
April 2018
permalink
Model not update twice
If you Debug::dump() the object before the save(), check the values of _data and _original. is_changed() compares the two to see if there is something that needs saving. Also, after a save(), _data and _original should be in sync.
Comment by
WanWizard
March 2018
permalink
Model not update twice
I can't reproduce it in 1.9-dev. My test code: // create test dataDBUtil::truncate_table('test');$query = DB::insert('test', array('name'))->values(array('Name'))->execute(); // get the record$test …
Comment by
WanWizard
March 2018
permalink
Model not update twice
Which Fuel version?
Comment by
WanWizard
March 2018
permalink
Test failures in fresh project
There is an 1.8 update on the way with will incorporate all fixes in develop.
Comment by
WanWizard
March 2018
permalink
Remove EAV properties from DB?
It is logical the first attempt doesn't work. That deletes setting records in the table, but doesn't delete the related objects from the project, so when you save the project, the ORM sees the still related setting objects as new, and save…
Comment by
WanWizard
March 2018
permalink
Question regarding PHP support
Unfortunately 2077 might be potentionally very difficult. Removing it will be relatively easy, but it might have a big impact for existing applications in a utf8 environment. The main reason it hasn't been picked up yet.
Comment by
WanWizard
March 2018
permalink
More Comments
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
About
Username
WanWizard
Joined
January 2011
Visits
2,366
Last Active
April 29
Roles
Administrator