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
Fatal error: Cannot access protected property Orm\Query::$alias in /var/www/public_html/vb_app.dev/f
Could you post the exact ORM query that causes this error (look higher up in the backtrace)? I tried $test = \Model\Test::query()->select('id')->where('id', '=', 1)->get_one(); here, and that runs fine.
Comment by
WanWizard
May 2015
permalink
Fatal error: Cannot access protected property Orm\Query::$alias in /var/www/public_html/vb_app.dev/f
The issue was reported here: https://github.com/fuel/orm/issues/370 so it looks like it was closed prematurely...
Comment by
WanWizard
May 2015
permalink
Fatal error: Cannot access protected property Orm\Query::$alias in /var/www/public_html/vb_app.dev/f
Which PHP version are you on?
Comment by
WanWizard
May 2015
permalink
How to forge two files in View::forge()
A View is an object, so it's quite logical that object Page2 can not access properties of object Page1. There is no automatic inheritance of properties if one view file includes another. Personally I don't think a view should contain code…
Comment by
WanWizard
May 2015
permalink
How to forge two files in View::forge()
You mean you have an extra layer of views, like: template -> content-section -> sub-elements ? Not a problem, just do the same as you would do with the template: $view = View::forge("page1", $data);$view->content = View::forge(&…
Comment by
WanWizard
May 2015
permalink
Help with fill form::select from ORM
Use Arr::pluck(): // get all user records $collection = Model_Users::get(); // extract an assoc array with id -> name // result: array(2 => 'Bill', 5 => 'Chris', 7 => 'Bert'); $names = \Arr::pluck($collect…
Comment by
WanWizard
May 2015
permalink
How to exclude id(primary key) in ORM find result?
An ORM is not a query builder. It is a bad thing to use select(),it will create partials objects, and once created, you will never be able to fetch the remaining data. Use it only if you know what you are doing. An ORM requires the primary key to…
Comment by
WanWizard
May 2015
permalink
How to programmatically create and destroy database connections in the db.php config
This is because you're changing existing configuration, which I told you you should not do. If you need to switch databases, change "db.active" to point to the new database definition. If you need to create that definition at runtime…
Comment by
WanWizard
May 2015
permalink
Input, Output and Data storage security
1. Yes. You can have it checked globally (there's a security config key for that) but the problem is it happens so early in the loading of the framework that you can't properly capture it, which is needed if you want to give the user an …
Comment by
WanWizard
May 2015
permalink
phpunit test Controllers
I wouldn't know, I have always found statics difficult to test, and never bothered. Ideally you should test individual controller methods directly, in isolation, and not the entire Request/Response chain.
Comment by
WanWizard
May 2015
permalink
The session data stored by the application in the cookie exceeds 4Kb
As said, I usually use an external service for bulk mail, but I don't really consider 200 emails bulk. Assuming your production server can send out email (either via a mail server of your provider, or using a mailserver running on the server …
Comment by
WanWizard
May 2015
permalink
Input, Output and Data storage security
That is a very broad question. ;-) Fuel doesn't do much automatically, it is not our philosophy. We try to provide some sane defaults, but always want the developer to be in control, not the framework. For example, most frameworks strip and …
Comment by
WanWizard
May 2015
permalink
The session data stored by the application in the cookie exceeds 4Kb
You are using the mail driver, which uses the PHP function mail() to send out email. You get this error if this function returns false. Under what conditions that happens, I don't really know. I personally tend to avoid this driver, and use th…
Comment by
WanWizard
May 2015
permalink
One refine for all packages migrations
oil refine migrate --all And if you're on 1.8/develop, skipped migrations (those that return false) will be automatically retried.
Comment by
WanWizard
May 2015
permalink
How to programmatically create and destroy database connections in the db.php config
Why go through all this trouble if all you have to do is change the value of 'db.active' to switch to a different database (definition)? I still struggle to understand why you want to make life so difficult for yourself. Extending or mod…
Comment by
WanWizard
May 2015
permalink
How to programmatically create and destroy database connections in the db.php config
The problem is that you're still trying to do things the system is not designed for. You should NOT alter database configurations at runtime! You can ADD new configurations as much as you like. The name of these configurations is not relevant,…
Comment by
WanWizard
May 2015
permalink
How to programmatically create and destroy database connections in the db.php config
DBUtil contains schema manipulation methods, it has nothing to do with database selections whatsoever. You are getting the 'data source' error because the active DB is still set to 'default', so you can't remove the '…
Comment by
WanWizard
May 2015
permalink
How to programmatically create and destroy database connections in the db.php config
Whatever the default database is (the one used if you don't specify one) is determined by the configuration key 'active'. If not defined in your db.php, it defaults to: /* * If you don't specify a DB configuration name …
Comment by
WanWizard
May 2015
permalink
The session data stored by the application in the cookie exceeds 4Kb
Don't forget to create the session table, there's a task to create it for you: php oil r session:create
Comment by
WanWizard
May 2015
permalink
The session data stored by the application in the cookie exceeds 4Kb
In general, use 'cookie' only if you don't have any backend storage (for example you're on a two-bit shared host with a slow db) or you have very little to store. As to 'db', 'memcached', 'redis' or…
Comment by
WanWizard
May 2015
permalink
Database view 'viewname' is defined without columns
It looks like that post is incorrect. If I look at the code, it is looking for a 'columns' array key, so: protected static $_views = array( 'hugot_summary' => array( 'columns' => array( …
Comment by
WanWizard
May 2015
permalink
Model_Soft and Many to Many relationship not cooperating.
Ah, ok. The through-table isn't aware of the "softness" of both parents. I don't think this is supported, please create a ticket for it at https://github.com/fuel/orm/issues so Steve can comment on it (Model_Soft is his baby), h…
Comment by
WanWizard
May 2015
permalink
Help me please with recursive deletion
It should disconnect by itself, by updating the foreign key by NULL. And that works fine. You got an error that the primary key was reset, and that can't happen, unless you have a FK that is also a PK. Which is a situation that is not supporte…
Comment by
WanWizard
May 2015
permalink
plural problem
The Fuel Inflector class only has a ruleset for the English language, and no option to load another ruleset (other than overloading the class). We never found it very useful, I personally don't think it's a good idea to localize table and…
Comment by
WanWizard
May 2015
permalink
Help me please with recursive deletion
I'm just trying to understand what you do and what happens. I know what the code does. I am absolutely sure that the ORM will not INVENT new data. If the ORM decides some object needs saving, it's because it has been changed. If the save …
Comment by
WanWizard
May 2015
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,367
Last Active
May 4
Roles
Administrator