# |
Jan 10th 2020, 16:34 |
slackebot |
Baking controller class for Results... Creating file /opt/lampp/htdocs/trportal/src/Controller/ResultsController.php Wrote `/opt/lampp/htdocs/trportal/src/Controller/ResultsController.php` Bake is detecting possible fixtures... Baking test case for App\Controller\ResultsController ... Creating file /opt/lampp/htdocs/trportal/tests/TestCase/Controller/ResultsControllerTest.php Wrote |
# |
Jan 10th 2020, 16:34 |
slackebot |
/opt/lampp/htdocs/trportal/tests/Fixture/ResultsFixture.php Wrote `/opt/lampp/htdocs/trportal/tests/Fixture/ResultsFixture.php` Deleted `/opt/lampp/htdocs/trportal/tests/Fixture/empty` Bake is detecting possible fixtures... Baking test case for App\Model\Table\ResultsTable ... Creating file /opt/lampp/htdocs/trportal/tests/TestCase/Model/Table/ResultsTableTest.php Wrote `/opt/lampp/htdocs/trportal/tests/TestCase/Model/Table/ResultsTableTest.php` |
# |
Jan 10th 2020, 16:34 |
slackebot |
`/opt/lampp/htdocs/trportal/src/Model/Table/ResultsTable.php` Deleted `/opt/lampp/htdocs/trportal/src/Model/Table/empty` Baking entity class for Result... Creating file /opt/lampp/htdocs/trportal/src/Model/Entity/Result.php Wrote `/opt/lampp/htdocs/trportal/src/Model/Entity/Result.php` Deleted `/opt/lampp/htdocs/trportal/src/Model/Entity/empty` Baking test fixture for Results... Creating file |
# |
Jan 10th 2020, 16:34 |
slackebot |
results`, with the following result: ```$ ./bin/cake bake all results Bake All --------------------------------------------------------------- One moment while associations are detected. <warning>Bake cannot generate associations for composite primary keys at this time</warning>. Baking table class for Results... Creating file /opt/lampp/htdocs/trportal/src/Model/Table/ResultsTable.php Wrote |
# |
Jan 10th 2020, 16:34 |
slackebot |
url VARCHAR(1024), added_by INT(11) UNSIGNED, added_on DATETIME, FOREIGN KEY (added_by) REFERENCES users(id), PRIMARY KEY (job_processing_id, test_type_id, test_counter) );``` 3. I edited `config/app.php` with database access credentials. 4. I checked the default landing page and got all 9 green chef's hats. 5. I ran `./bin/cake bake all users` successfully. All user actions perform as expected. 6. I ran `./bin/cake bake all |
# |
Jan 10th 2020, 16:34 |
slackebot |
NOT NULL, status TINYINT(1) UNSIGNED DEFAULT 1, created_by INT(11) UNSIGNED, FOREIGN KEY (created_by) REFERENCES users(id), created_on DATETIME ); CREATE TABLE results ( job_processing_id INT(11) UNSIGNED, test_type_id INT(5) UNSIGNED, test_counter INT(5) UNSIGNED, number VARCHAR(20), country VARCHAR(100), start_time DATETIME, end_time DATETIME, connect_time DATETIME, score FLOAT(5, 2) UNSIGNED, |
# |
Jan 10th 2020, 16:34 |
wizardfix |
Hi. :) I have a baking problem with which I would be grateful for help: *Error baking table* 1. I created a CakePHP 3.8 app, `trportal`. 2. I created `trdb`, a database of two tables (`users` and `results`) with the below SQL: ```CREATE TABLE users ( id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(128) NOT NULL, email VARCHAR(512) NOT NULL UNIQUE, admin TINYINT(1) UNSIGNED DEFAULT 0, password VARCHAR(128) |
# |
Jan 10th 2020, 16:20 |
jotpe |
Nothin seems to work. |
# |
Jan 10th 2020, 16:20 |
jotpe |
```public function beforeRender(Event $event) { parent::beforeRender($event); $this->viewBuilder()->helpers(['Users.User']); }``` |
# |
Jan 10th 2020, 16:20 |
jotpe |
In my AppView: $this->loadHelper('Users.User'); or in my Controller: |
# |
Jan 10th 2020, 16:19 |
jotpe |
And yes it is in a plugin and yes, I used plugin syntax :) |
# |
Jan 10th 2020, 16:19 |
jotpe |
What could cause a helper not to get loaded? |
# |
Jan 10th 2020, 15:56 |
lubos |
when i trying to save text from twitter with emoji into database, i am getting sql error, i would expect this to be escaped. any idea? |
# |
Jan 10th 2020, 15:53 |
neon1024 |
I’m sure the authors would appreciate your help to upgrade them! I know @dereuromark has a big to do list of upgrades, perhaps you could help him out :) |
# |
Jan 10th 2020, 15:53 |
neon1024 |
@ssalvatori This sounds like the plugins your project is using have not been upgraded to cake 4 yet |
# |
Jan 10th 2020, 15:43 |
kevin.pfeifer |
thx :) |
# |
Jan 10th 2020, 15:40 |
kevin.pfeifer |
just checked the save docu |
# |
Jan 10th 2020, 15:40 |
kevin.pfeifer |
didnt look for the timestamp behaviour docu itself |
# |
Jan 10th 2020, 15:39 |
kevin.pfeifer |
ah im sorry |
# |
Jan 10th 2020, 15:39 |
dereuromark |
or as touched |
# |
Jan 10th 2020, 15:39 |
dereuromark |
check the docs |
# |
Jan 10th 2020, 15:38 |
dereuromark |
it is documented. setting it to false or sth |
# |
Jan 10th 2020, 15:38 |
kevin.pfeifer |
hello community! Is there a way to update/save an entity without triggering the "Timestamp" behaviour which changes the modified date? |
# |
Jan 10th 2020, 15:37 |
ndm |
You probably should elaborate on the latter problem, ie what exactly is the problem |
# |
Jan 10th 2020, 15:24 |
ssalvatori |
I managed to remove all the errors and upgrade cakephp but now I can´t install debug_kit |
# |
Jan 10th 2020, 15:23 |
ssalvatori |
hello .. I´m trying to upgrade to cakephp4 but I'm having many error with composer like debug_kit not compatible and some others modules |
# |
Jan 10th 2020, 15:05 |
neon1024 |
@mocelle Are you talking about ajax? |
# |
Jan 10th 2020, 15:05 |
slackebot |
!xy |
# |
Jan 10th 2020, 15:05 |
slackebot |
Command sent from Slack by neon1024: |
# |
Jan 10th 2020, 14:39 |
ndm |
@mocelle There's a way for almost anything, but why exactly do you need a different folder for your controllers? |
# |
Jan 10th 2020, 14:12 |
mocelle |
Hi! Is there way to create own Controller folder under src and call controller in web Browser? |
# |
Jan 10th 2020, 14:11 |
ndm |
Looking at shadow translate, the query would probably be rather similar in this specific case... but in general I would probably prefer it over EAV too. |
# |
Jan 10th 2020, 14:06 |
admad |
which is why i have always used shadow table translate :) |
# |
Jan 10th 2020, 14:05 |
ndm |
super fun :grimacing: |
# |
Jan 10th 2020, 14:05 |
admad |
would be great fun creating query for that using the core eav translate |
# |
Jan 10th 2020, 14:05 |
slackebot |
(\Cake\ORM\Query $query) { return $query->where([ 'I18n.field' => 'title', ]); }) ->where([ 'OR' => [ 'I18n.content' => 'search term', 'TableAlias.title' => 'search term', ] ]) ->group('TableAlias.id');``` Untested but should work I think... |
# |
Jan 10th 2020, 14:05 |
ndm |
As I said there's lots of different ways to do it... the translate behavior creates `hasOne` associations for every single translatable field, and a single `hasMany` association for all fields. Searching via the latter could look something like left joining it on the field name, and then using conditions on its `content` field and the main tables actual field, something like: ```$query = $table ->find() ->leftJoinWith('I18n', function |
# |
Jan 10th 2020, 14:04 |
ndm |
of course, it always has to be most complex one :) |
# |
Jan 10th 2020, 13:53 |
naino |
both |
# |
Jan 10th 2020, 13:50 |
ndm |
And you want to only search in the translations, or also in the original language? |
# |
Jan 10th 2020, 13:46 |
ndm |
So like the second example then... |