# |
Jul 23rd 2021, 10:51 |
kevin.pfeifer |
|
# |
Jul 23rd 2021, 10:50 |
kevin.pfeifer |
The Flash message topic is pretty re-occuring. let me search the slack for how to do that |
# |
Jul 23rd 2021, 10:37 |
paolo.bragagni |
and what about flash message that shows user that it hasnt the authorization? |
# |
Jul 23rd 2021, 10:37 |
paolo.bragagni |
something like 'url' => $this->referer() |
# |
Jul 23rd 2021, 10:36 |
paolo.bragagni |
'unauthorizedHandler' => [ 'className' => 'Authorization.Redirect', 'url' => '/users/login', 'queryParam' => 'redirectUrl', 'exceptions' => [ MissingIdentityException::class, OtherException::class, ], |
# |
Jul 23rd 2021, 10:36 |
paolo.bragagni |
Hi in unauthorizedHandler how to redirect to last page? |
# |
Jul 23rd 2021, 00:14 |
web-54 |
hello |
# |
Jul 22nd 2021, 17:47 |
zxcvxcvzxcv |
=# |
# |
Jul 22nd 2021, 15:00 |
tyler.adam.lazenby |
hahaha |
# |
Jul 22nd 2021, 15:00 |
tyler.adam.lazenby |
Thanks @dereuromark I will have to go back the white board and figure out my logic. again |
# |
Jul 22nd 2021, 13:23 |
paolo.bragagni |
I know I know but I need it. I'll do my own thanks. |
# |
Jul 22nd 2021, 13:02 |
ndm |
That aside, that plugin is so basic, just do your own. |
# |
Jul 22nd 2021, 13:00 |
ndm |
Using embedded SQL queries sounds like a terrible idea, IMHO that's a job for stored procedures and/or views. |
# |
Jul 22nd 2021, 12:53 |
paolo.bragagni |
something similar to this https://github.com/morrislaptop/reports for cake4? |
# |
Jul 22nd 2021, 12:17 |
paolo.bragagni |
ok thank you |
# |
Jul 22nd 2021, 12:10 |
kevin.pfeifer |
there are many ways how you can interact with migrations |
# |
Jul 22nd 2021, 12:10 |
dereuromark |
if you used change(), just use "migrations rollback", done |
# |
Jul 22nd 2021, 12:10 |
kevin.pfeifer |
or use rollback https://book.cakephp.org/migrations/2/en/index.html |
# |
Jul 22nd 2021, 12:08 |
kevin.pfeifer |
manually delete the table with SQL CLI, PHPMyAdmin or whatever DB management tool you desire |
# |
Jul 22nd 2021, 12:07 |
paolo.bragagni |
with someting changed? |
# |
Jul 22nd 2021, 12:04 |
paolo.bragagni |
(if I want to rerun ?) |
# |
Jul 22nd 2021, 12:04 |
paolo.bragagni |
yes you are great |
# |
Jul 22nd 2021, 12:01 |
paolo.bragagni |
ops not save |
# |
Jul 22nd 2021, 12:00 |
paolo.bragagni |
something wrong in my config |
# |
Jul 22nd 2021, 11:59 |
kevin.pfeifer |
this creates the table `checklist_types` with the columns id, name, created and modified with 3 entries |
# |
Jul 22nd 2021, 11:59 |
paolo.bragagni |
should include checklist_types table? |
# |
Jul 22nd 2021, 11:46 |
kevin.pfeifer |
```bin/cake bake migration MySuperMigration``` open confg/Migrations/<DATE>_MySuperMigration.php insert into `change()` function ``` $checklist_types_table = $this->table( 'checklist_types' ); $checklist_types_table->addColumn( 'name', 'string' ); $checklist_types_table->addColumn( 'created', 'datetime', [ 'default' => 'CURRENT_TIMESTAMP', 'null' => false, ] ); |
# |
Jul 22nd 2021, 11:46 |
slackebot2 |
$checklist_types_table->addColumn( 'modified', 'datetime', [ 'default' => 'CURRENT_TIMESTAMP', 'null' => false, ] ); $checklist_types_table->create(); $checklist_types_table->insert( [ 'name' => 'Wordpress' ] ); $checklist_types_table->insert( [ 'name' => 'Drupal' ] ); $checklist_types_table->insert( [ 'name' => 'WooCommerce' ] ); $checklist_types_table->saveData();``` execute |
# |
Jul 22nd 2021, 11:46 |
slackebot2 |
```bin/cake migrations migrate``` |
# |
Jul 22nd 2021, 11:46 |
dereuromark |
you can execute seeds for demo data afterwards |
# |
Jul 22nd 2021, 11:42 |
paolo.bragagni |
trying.. I'd like only to create some tables (users, roles, ..) and fill with default values.. |
# |
Jul 22nd 2021, 11:18 |
dereuromark |
migrations? |
# |
Jul 22nd 2021, 11:02 |
paolo.bragagni |
what is the cakephp 4 corresponding to 'cake schema' ? I'd like to insert some tables in default DB |
# |
Jul 22nd 2021, 10:25 |
paolo.bragagni |
thanks! |
# |
Jul 22nd 2021, 08:54 |
paolo.bragagni |
(thanks ndm) |
# |
Jul 22nd 2021, 08:53 |
paolo.bragagni |
probably is only a theme problem |
# |
Jul 22nd 2021, 08:45 |
ndm |
Sure, but select2 already supports that, hence your question was unclear. |
# |
Jul 22nd 2021, 08:36 |
paolo.bragagni |
if I erroneusly select something and I want to clear it |
# |
Jul 22nd 2021, 07:58 |
paolo.bragagni |
so probably is only a bug in Select2 bootstrap theme |
# |
Jul 22nd 2021, 07:58 |
paolo.bragagni |
an x that 'clear' the input |
# |
Jul 22nd 2021, 07:58 |
paolo.bragagni |
|
# |
Jul 22nd 2021, 07:57 |
paolo.bragagni |
if I remove that I see this |
# |
Jul 22nd 2021, 07:57 |
paolo.bragagni |
humm probably it is the 'bootstrap4' theme |
# |
Jul 22nd 2021, 07:55 |
ndm |
@paolo.bragagni Why would the "empty" entry stay once you've made a selection? |
# |
Jul 22nd 2021, 07:45 |
ndm |
@dpaleria Debug your values to figure what exactly they look like (`debug($id); debug($params);`), it's very likely not a type issue, but the value that you are passing is not numeric. |
# |
Jul 22nd 2021, 07:44 |
paolo.bragagni |
no more 'Vuoto' (Empty) |
# |
Jul 22nd 2021, 07:44 |
paolo.bragagni |
|
# |
Jul 22nd 2021, 07:43 |
paolo.bragagni |
it shows, but if I enter something it disappares |
# |
Jul 22nd 2021, 07:43 |
paolo.bragagni |
when it is Empty (Vuoto) |
# |
Jul 22nd 2021, 07:40 |
ndm |
@val There's no dedicated method for it, but you can append the existing order to your input and then overwrite the order, like: ```$query->order( ['field' => 'ASC', $query->clause('order')], true );``` |
# |
Jul 22nd 2021, 07:21 |
val |
hi, is is possible to prepend an `order by` clause to the existing `order by` clauses in 3.x (instead of appending it to the end)? |
# |
Jul 22nd 2021, 06:30 |
paolo.bragagni |
if the field is already empty Select2 shows the placeholder, otherwise no |
# |
Jul 22nd 2021, 06:25 |
paolo.bragagni |
in add the 'allowClear' and placeholder do the works |
# |
Jul 22nd 2021, 06:25 |
paolo.bragagni |
no way to insert empty selection using Select2 in edit |
# |
Jul 22nd 2021, 05:42 |
dpaleria |
hey everyone, I'm accessing this url `http://localhost:2354/images/get-imageid/111223` and now I'm using params to access the number `1112233` and put that as an input for a function in the controllers. This is how the controllers look like: `public function getImageid($id=null)` `{` `$params=$this->request->getParam('pass');` `$arti_id=$params[0];` `$abc = $this->Images->get($id, array(` |
# |
Jul 22nd 2021, 05:42 |
slackebot2 |
`'conditions' => array('artifact_id' => $arti_id)` `));` `$this->set(compact('abc'));` `return $this->redirect(['action'=>'view', $abc['id']]);` `}` But I'm unable to access the params from url. Which gives me the below error: I'm pretty sure that error is not of any data type instead it is a mistake in my function but I'm unable to find the mistake. Any idea on this ? Thanks ! |
# |
Jul 22nd 2021, 00:21 |
dereuromark |
best to create then a record per entry, this way the queue can run those in parallel even if that's possible/desired |
# |
Jul 22nd 2021, 00:20 |
dereuromark |
ah that was a different person |
# |
Jul 22nd 2021, 00:20 |
dereuromark |
and again, you can just run the reset functionality over your records, it will batch process them all without memory issues etc. |
# |
Jul 22nd 2021, 00:19 |
dereuromark |
the payload is too big, make sure to use only references, not whole objects here |
# |
Jul 21st 2021, 23:09 |
tyler.adam.lazenby |
@dereuromark any ideas on how to troubleshoot that? |
# |
Jul 21st 2021, 23:08 |
tyler.adam.lazenby |
2021-07-21 17:08:32 Notice: Notice (8): unserialize(): Error at offset 64025 of 65535 bytes in [C:\xampp\htdocs\ezBusinessManag er\vendor\dereuromark\cakephp-queue\src\Queue\Processor.php, line 187]\ |
# |
Jul 21st 2021, 23:08 |
tyler.adam.lazenby |
I ALMOST had it.... almost then this started to get spat out |
# |
Jul 21st 2021, 22:20 |
tyler.adam.lazenby |
maybe if I split up the jobs into groups of records |
# |
Jul 21st 2021, 22:13 |
tyler.adam.lazenby |
I am using queue by the way |
# |
Jul 21st 2021, 22:12 |
tyler.adam.lazenby |
Any suggestions how to approach the logic of imporing 5000+ histories into the database? |
# |
Jul 21st 2021, 22:06 |
tyler.adam.lazenby |
Ungh this is so much slower |
# |
Jul 21st 2021, 22:00 |
tyler.adam.lazenby |
I have it in the form of dto's, and unique composite ids |
# |
Jul 21st 2021, 22:00 |
kevin.pfeifer |
then I hope you have your loop detection pretty solid :) |
# |
Jul 21st 2021, 21:51 |
tyler.adam.lazenby |
instead of making the task go through each history (which there might be hundreds), I am going to make the system just create a new task for each history |
# |
Jul 21st 2021, 21:51 |
tyler.adam.lazenby |
hmmmmm, I have an idea |
# |
Jul 21st 2021, 21:16 |
grzes |
but i had a bug in counter cache condition and now i need to refresh all records after fixing the conditions |
# |
Jul 21st 2021, 21:02 |
kevin.pfeifer |
@grzes according to https://book.cakephp.org/4/en/orm/behaviors/counter-cache.html#basic-usage ```The counter's value will be updated each time an entity is saved or deleted. The counter will not be updated when you use updateAll() or deleteAll(), or execute SQL you have written.``` |
# |
Jul 21st 2021, 21:01 |
tyler.adam.lazenby |
I hate it when you have to build for large amounts of data! |
# |
Jul 21st 2021, 20:56 |
grzes |
how can i manually refresh counter cache? |
# |
Jul 21st 2021, 19:40 |
kevin.pfeifer |
the difference between cakephp 3 and 4 wouldn't be that much I would guess |
# |
Jul 21st 2021, 19:40 |
kevin.pfeifer |
maybe try https://github.com/mattmemmesheimer/cakephp-3-acl-example ? |
# |
Jul 21st 2021, 19:20 |
Aspirant |
Hi Everyone any great tutorial for implementation of ACL in cakphp 4.2.8 strawberry |
# |
Jul 21st 2021, 15:15 |
kevin.pfeifer |
you too :wave: |
# |
Jul 21st 2021, 15:14 |
Guest481 |
nice day/evening |
# |
Jul 21st 2021, 15:14 |
Guest481 |
have to leave |
# |
Jul 21st 2021, 15:14 |
Guest481 |
by the way |
# |
Jul 21st 2021, 15:08 |
Guest481 |
completely !! and i didn't follow the train because i moved to Azure and AWS cloud admin and without 3 years playing with theses frameworks...i'm now obsolete and back in that wolrd from scratch haha |
# |
Jul 21st 2021, 15:06 |
kevin.pfeifer |
well those modern frontend JS frameworks are a completely different topic :) |
# |
Jul 21st 2021, 15:05 |
Guest481 |
but i'm an old school jquery guy, not up to date on angular, vue etc.. |
# |
Jul 21st 2021, 15:05 |
Guest481 |
the most complicated is to create a beautiful interface |
# |
Jul 21st 2021, 15:04 |
Guest481 |
lol yes sometimes this is necessarry |
# |
Jul 21st 2021, 14:59 |
kevin.pfeifer |
I too myself just recently refactored a bunch of arrays and other primitive data from their respected classes into actual config arrays ,:) |
# |
Jul 21st 2021, 14:58 |
Guest481 |
yes for now i'll do like that and when my project will be more complete i'll tune all of that |
# |
Jul 21st 2021, 14:56 |
kevin.pfeifer |
but thats something you can pretty easiely adjust at a later time if you so desire |
# |
Jul 21st 2021, 14:55 |
kevin.pfeifer |
but as said from cnizzardini if these constants are "just" strings or integers then a config entry would be much easier to work with |
# |
Jul 21st 2021, 14:54 |
Guest481 |
many thanks for your precious advice |
# |
Jul 21st 2021, 14:53 |
kevin.pfeifer |
if you have logic which should be present in many controllers then sure, a component is meant for that But the moment you need that same logic somewhere else (e.g. inside a Command) the generic PHP Class approach is better |
# |
Jul 21st 2021, 14:51 |
kevin.pfeifer |
you shouldn't call controller methods from other parts in the framework because they are only meant to be invoked via URLs (/my-controller/my-function) You should rather refactor that logic inside your controller function into sort of generic class which then can be called from your controller or anywhere else you want. |
# |
Jul 21st 2021, 14:35 |
Guest481 |
a component is better maybe ? |
# |
Jul 21st 2021, 14:35 |
Guest481 |
hmm and to call a method from a controller ? |
# |
Jul 21st 2021, 14:33 |
kevin.pfeifer |
so `src/Utility/MyUtility.php` would have to have the Namespace `App/Utility` and can be accessed via `App/Utility/MyUtility::MY_CONSTANT` |
# |
Jul 21st 2021, 14:33 |
Guest481 |
yep you are right |
# |
Jul 21st 2021, 14:32 |
kevin.pfeifer |
src is mapped to the `App` namespace see composer.json |
# |
Jul 21st 2021, 14:32 |
Guest481 |
i would need to have a "use App\MyClass" at the beginning of my controller to use it ? |