# |
Aug 19th 2019, 13:58 |
davorminchorov |
Is there a toSql / event listener for queries like Laravel? |
# |
Aug 19th 2019, 13:58 |
dereuromark |
or if the query is overwriting it somehow, thus the need to see the query :slightly_smiling_face: |
# |
Aug 19th 2019, 13:57 |
admad |
actually that's what needed to be checked earlier instead of `getColumn()` :slightly_smiling_face: |
# |
Aug 19th 2019, 13:56 |
admad |
check `debug($table->getSchema()->getColumnType('description'))` first |
# |
Aug 19th 2019, 13:55 |
admad |
that would only happen if your app/plugin code is explicitly overriding the type |
# |
Aug 19th 2019, 13:54 |
admad |
ok, so your table schema seems find, then somewhere in the query the field gets overridden to integer type |
# |
Aug 19th 2019, 13:53 |
davorminchorov |
``` array:8 [▼ "type" => "string" "length" => 255 "null" => true "default" => null "collate" => "latin1_swedish_ci" "comment" => "" "precision" => null "fixed" => null ] ``` |
# |
Aug 19th 2019, 13:50 |
admad |
or whatever the column/field is with the problem |
# |
Aug 19th 2019, 13:50 |
admad |
@davorminchorov show the output of `debug($table->getSchema()->getColumn('description'))` |
# |
Aug 19th 2019, 13:50 |
davorminchorov |
@admad clearing schema and orm cache did not help |
# |
Aug 19th 2019, 13:49 |
admad |
debugkit has a panel which shows "auto tables" btw |
# |
Aug 19th 2019, 13:49 |
val |
thanks, got it |
# |
Aug 19th 2019, 13:49 |
admad |
it would return Cake\ORM\Entity instance only if "auto table" is used or you haven't created App\Model\Entity\Entity |
# |
Aug 19th 2019, 13:49 |
ricksaccous |
if you have an entity class defined for that model it should use the entity class you created |
# |
Aug 19th 2019, 13:48 |
val |
Is `$this->find()->first();` called in table class in 3.x supposed to return an instance of Cake\ORM\Entity but not Model\MyEntity? |
# |
Aug 19th 2019, 13:46 |
alexdd55976 |
i am not even far enough to have that |
# |
Aug 19th 2019, 13:45 |
admad |
@alexdd55976 assuming sessions are working on your shitty environment, a common cause for session being lost is links to non existent assets on pages |
# |
Aug 19th 2019, 13:44 |
alexdd55976 |
`$this->Flash ` is not working either |
# |
Aug 19th 2019, 13:44 |
alexdd55976 |
@ricksaccous i can not find any configuration key, that could help here... any idea? its a crappy windows machine with xampp |
# |
Aug 19th 2019, 13:43 |
davorminchorov |
done that just now, let me see if that fixes it |
# |
Aug 19th 2019, 13:43 |
admad |
or just manually delete files in cache/models |
# |
Aug 19th 2019, 13:42 |
admad |
orm_cache |
# |
Aug 19th 2019, 13:42 |
davorminchorov |
cache clear_all? |
# |
Aug 19th 2019, 13:41 |
admad |
cleared db cache? |
# |
Aug 19th 2019, 13:41 |
davorminchorov |
@admad yeah I did check that and they are varchar. @dereuromark I'll try to get the SQL and post it here |
# |
Aug 19th 2019, 13:41 |
alexdd55976 |
@ricksaccous actually i was so desperate i candp the code from an old project |
# |
Aug 19th 2019, 13:40 |
ricksaccous |
@alexdd55976 i assume you're using authComponent? make sure your settings are set up correctly, and make sure your session settings are set up correctly, I think you'll have to look at your app.php as well as your php configuration ini |
# |
Aug 19th 2019, 13:40 |
admad |
@davorminchorov are you sure the db column types are varchar/text ? |
# |
Aug 19th 2019, 13:39 |
dereuromark |
@davorminchorov What is the SQL query doing this? Can you post that? |
# |
Aug 19th 2019, 13:39 |
alexdd55976 |
guys, what is going wrong if a session is not hold? i log in a user succesfully, but all data is gone after the login. ` $this->Auth->setUser($user);` this should do it, right? |
# |
Aug 19th 2019, 13:38 |
davorminchorov |
Nope, nowhere to be found |
# |
Aug 19th 2019, 13:36 |
admad |
check if you model class has _initializeSchema() method |
# |
Aug 19th 2019, 13:35 |
davorminchorov |
It's being cast to int but not sure how and why: ``` #2 /var/www/html/vendor/cakephp/cakephp/src/Database/Statement/PDOStatement.php(69): Cake\Database\Statement\StatementDecorator->cast('Some Info about...', Object(Cake\Database\Type\IntegerType)) ``` |
# |
Aug 19th 2019, 13:34 |
admad |
go further |
# |
Aug 19th 2019, 13:34 |
davorminchorov |
This looks like the issue ``` #3 /var/www/html/vendor/cakephp/cakephp/src/Database/ValueBinder.php(147): Cake\Database\Statement\PDOStatement->bindValue('c7', 'Some Info about...', 'integer') ``` |
# |
Aug 19th 2019, 13:32 |
admad |
follow the stack trace |
# |
Aug 19th 2019, 13:32 |
davorminchorov |
I have no idea, new to the framework. Where can I check that? |
# |
Aug 19th 2019, 13:31 |
admad |
why would those fields use `IntegerType`? |
# |
Aug 19th 2019, 13:31 |
dereuromark |
if you change the field(type), make sure to clear cache |
# |
Aug 19th 2019, 13:31 |
davorminchorov |
it's thrown for fields like description, email address etc |
# |
Aug 19th 2019, 13:31 |
dereuromark |
sounds like a cache issue then |