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
Security::htmlentities() is not working.
If that doesn't happen, you haven't configured your app properly. You need your security filters in your app/config.php. This is mine: /** * Security settings */ 'security' => array( 'csrf_auto…
Comment by
WanWizard
January 2014
permalink
Security::htmlentities() is not working.
Couple of weird things going on here. Input::get('post') suggests you're having a URL variable called "post". Then you say "$post variable HTML content", suggesting that the URL variable contained HTML? That soun…
Comment by
WanWizard
January 2014
permalink
Lang table and translations
Ok.
Comment by
WanWizard
January 2014
permalink
Trying to get property of non-object, but the object is fine
That depends. find() returns an array of Model_City objects, so so far so good. The question is whether all city objects have a country? Try: $country = $city->country ? $city->country->name : 'Unknown'; and see what happens?
Comment by
WanWizard
January 2014
permalink
Lang table and translations
You could move the where() clause of that query to the relation condition, if you always want to filter, and you have the language codes available globally. Problem with this setup is that you only want 1 record, and since the order of the result of…
Comment by
WanWizard
January 2014
permalink
Lang class
I don't see an immediate reason why this should not work. Can you see the loaded strings when you do \Debug::dump(\Lang::$lines); But I find it not very logical, by using "account.username" instead of "account_username", …
Comment by
WanWizard
January 2014
permalink
Lang table and translations
The id as PK is required. Techically, you can create a compound PK with both the product_id and lang_id (which is what you would do from a database normalisation point of view), but that could lead to issues with deleting related tables because so…
Comment by
WanWizard
January 2014
permalink
How to check if a user is a group member while not logged in
Since Auth has multiple driver support, a "user" is defined as an array with driver name and user identification. It's in a format as returned by get_user_id(), documented here: http://docs.fuelphp.com/packages/auth/drivers.html#/imp…
Comment by
WanWizard
January 2014
permalink
Illegal mix of collations
See http://dev.mysql.com/doc/refman/5.6/en/charset-collation-expressions.html This suggests that the collating sequence of the database is different from that off the table, causing a collations mix, which MySQL can't handle.
Comment by
WanWizard
January 2014
permalink
Invalid Model instance added to relations in this model error when updating roles on a user
Auth classes are aliased to global, and that is true for the models too (otherwise you can't extend them). This means you should use \Model\Auth_Role and not \Auth\Model\Auth_Role Because you do this, The ORM complains that you have assi…
Comment by
WanWizard
January 2014
permalink
how to get Value send by Get method by the form
Have you tried? Or checked the documentation?
Comment by
WanWizard
January 2014
permalink
Pagination seems useless
That would probably work, yes.
Comment by
WanWizard
January 2014
permalink
Pagination seems useless
To avoid the double query, I would probably do: - set the total pages hard coded to something very high - configure pagination to NOT show a 'last page' marker - cache the page results - run only the limit/offset query if no cache for that…
Comment by
WanWizard
January 2014
permalink
Pagination seems useless
It's an ORM model.
Comment by
WanWizard
January 2014
permalink
Pagination seems useless
Doesn't matter, you still need to run it once without the LIMIT and OFFSET to get the total number of rows in the result, which is required to calculate the number of pages. With 500K rows, how pointless is this in a paging context? How many p…
Comment by
WanWizard
January 2014
permalink
Pagination seems useless
You need to run two queries, one for the total count, one for the selection of data for the page. No way to do it in one go. So you get something like: // make sure $page contains something useful (int) $page < 1 and $page = 1; …
Comment by
WanWizard
January 2014
permalink
Omit domain from anchor
You can set the 'base_url' in your app/config/config.php to a relative path like "/". Then all methods that use the base URL will generate relative links. By default the base_url is not set and will be auto-detected, which means…
Comment by
WanWizard
January 2014
permalink
Auth sessions behave weird
Weird. Never heard from such an issue, never experienced it in any of our apps either. You could add some code to your index.php to write $_COOKIE to a file, and check what comes in on each page request. Check if you have a page request without a c…
Comment by
WanWizard
January 2014
permalink
Validation active_field
p.s. it's better to use \Debug::dump($this->active_field()); die(); it gives you a lot more information, plus options to navigate complex array's and objects.
Comment by
WanWizard
January 2014
permalink
Validation active_field
Looks ok. I think where you go wrong is assume that active_field() is a string, which it isn't, it's a Fieldset_Field object. So you can't output it in a die() like you do. Use $field = $this->active_field(); echo $field->na…
Comment by
WanWizard
January 2014
permalink
Validation active_field
Where is this method defined? How did you extend? The methods I mentioned use the same, and they do work. Validation only works on filled-in fields, this is by design. There is no "required_if" functionality at the moment. It's unl…
Comment by
WanWizard
January 2014
permalink
Validation active_field
Validation rules are only called if there is data to validate. If you don't want the field to be left blank, add the "required" rule to it. Validation rules in the validation class are not static. Other rules use $this->active_fi…
Comment by
WanWizard
January 2014
permalink
Rest Authentication does not work under default CGI configurations - Solution within
Ok, I'll update the .htaccess with this. Thanks for testing it!
Comment by
WanWizard
January 2014
permalink
Rest Authentication does not work under default CGI configurations - Solution within
Ok, so it has to become this? ... # Send request via index.php if not a real file or directory RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # deal with php5-cgi first # make HTTP Basic Au…
Comment by
WanWizard
January 2014
permalink
How to delete a meta data entry in OrmAuth?
In Ormauth, metadata is implemented as an EAV container. With a model, you can simply use unset($model->property) to remove a related object, a custom property or an EAV property. With update_user(), you have to pass NULL as the value of the EA…
Comment by
WanWizard
January 2014
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,371
Last Active
May 14
Roles
Administrator