# |
Jun 16th 2021, 15:15 |
slackebot |
=> 'string', 'length' => 255, 'null' => false, 'default' => null, 'collate' => 'latin1_swedish_ci', 'comment' => '', 'precision' => null], 'description' => ['type' => 'string', 'length' => 255, 'null' => true, 'default' => null, 'collate' => 'latin1_swedish_ci', 'comment' => '', 'precision' => null], '_constraints' => [ 'primary' => ['type' => 'primary', 'columns' => ['id', 'locale'], 'length' => []], ], '_options' |
# |
Jun 16th 2021, 15:15 |
rudy1976s |
```/** * Fields * * @var array */ // phpcs:disable public $fields = [ 'id' => ['type' => 'integer', 'length' => null, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null], 'locale' => ['type' => 'string', 'length' => 5, 'null' => false, 'default' => null, 'collate' => 'latin1_swedish_ci', 'comment' => '', 'precision' => null], 'name' => ['type' |
# |
Jun 16th 2021, 15:14 |
rudy1976s |
I have just baked a fixture |
# |
Jun 16th 2021, 15:10 |
ndm |
@rudy1976s Generally, yes, but that's irrespective of the column type, it depends on what is actually populating that column. |
# |
Jun 16th 2021, 15:09 |
ndm |
@tomrwaller Personally I use Xdebug (https://xdebug.org/docs/profiler), whether you'd consider that beginner friendly really depends... |
# |
Jun 16th 2021, 15:07 |
rudy1976s |
@ndm I would expect a 5 long string not 36 isnt'it ? |
# |
Jun 16th 2021, 15:02 |
tomrwaller |
By best I mean most beginner friendly :) |
# |
Jun 16th 2021, 15:02 |
tomrwaller |
@ndm What would be the best way to do that? |
# |
Jun 16th 2021, 15:01 |
rudy1976s |
the filling is happening in the record array of the fixture file |
# |
Jun 16th 2021, 14:44 |
ndm |
That looks OK... now where exactly is that filling happening? |
# |
Jun 16th 2021, 14:43 |
rudy1976s |
```'locale' => ['type' => 'string', 'length' => 5, 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => '', 'precision' => null],``` |
# |
Jun 16th 2021, 14:43 |
rudy1976s |
the locale field generated by bnake is like the following : |
# |
Jun 16th 2021, 14:42 |
rudy1976s |
the locale field is always filled with random generated uuid it seems |
# |
Jun 16th 2021, 14:42 |
rudy1976s |
all from console |
# |
Jun 16th 2021, 14:42 |
rudy1976s |
I have also baked the table and entity tests |
# |
Jun 16th 2021, 14:41 |
rudy1976s |
@ndm I am baking fixtures from shell about two tables where one is a shadow strategy translation table |
# |
Jun 16th 2021, 14:40 |
ndm |
@rudy1976s What exactly is filling your locale field where exactly? Are you talking about baking fixtures? Importing records for the fixtures? |
# |
Jun 16th 2021, 14:36 |
ndm |
@tomrwaller I'd suggest to start with profiling where exactly in the code the memory usage accumulates, and go from there. |
# |
Jun 16th 2021, 14:26 |
rudy1976s |
the lenght of the filled string is 36 which seems a uiid |
# |
Jun 16th 2021, 14:25 |
rudy1976s |
hello I am creating Fixtures for my tables: I have Translations using Shadow strategy: when creating fixtures I have always the locale field filled with a string much more bigger than 5, which is the limit. is there something to do to avoid this behavior ? I always need to modify Fixtures by hand |
# |
Jun 16th 2021, 14:13 |
tomrwaller |
I have about 200 answers in my current test. I get the error below when I try to save... `Allowed memory size of 268435456 bytes exhausted (tried to allocate 163986352 bytes)` |
# |
Jun 16th 2021, 14:12 |
tomrwaller |
`<?php foreach ($assessment->answers as $key => $answer) : ?>` `... make a table ...` `<?php echo $this->Form->control('answers.' . $key . '.applicable'); ?>` `... about 10 more of these controls for different fields ...` `<?php endforeach; ?>` |
# |
Jun 16th 2021, 14:10 |
tomrwaller |
At the moment, I have an assessment, that has a whole bunch of associated answers. Those answers have some TINYINT fields among others that I'm presenting to a 'run' view - basically the assessment with a table of all the answers with relevant checkboxes. It works, but when I added some additional fields for each answer, such as comments, I now get the memory error. |
# |
Jun 16th 2021, 14:09 |
tomrwaller |
Can anybody share with me the most 'efficient' way of updating loads of associated entities from a single view? I say efficient, because the way I'm doing it at the moment has started throwing up SQL memory exhaustion errors, and I'm pretty sure it's down to the fact I'm trying to update ~200 associated entities from a single view. |
# |
Jun 16th 2021, 10:03 |
rudy1976s |
I don't know if that depends on my side or not but I noticed in other plugin it's alwayes there. |
# |
Jun 16th 2021, 10:02 |
rudy1976s |
I had to modify plugin composer.json and add reference to the fixture in autoload and not in autoload-dev as described in the docs |
# |
Jun 16th 2021, 10:01 |
rudy1976s |
@steinkel I fixed my problem |
# |
Jun 16th 2021, 09:01 |
neon1024 |
@steinkel Thanks for the offer to open source the CakeDC SAML plugin. Now I’ve learnt a bit more about SAML and the flow, it seems a plugin would be very handy. I have created my own Authenticator, Identifier and Resolver classes, but the AuthnRequest returns a redirect url and I’m a bit lost how I can control the redirect flow from inside an Authentication Resolver |
# |
Jun 16th 2021, 08:11 |
rudy1976s |
@steinkel I will make a try , thank you |
# |
Jun 16th 2021, 08:09 |
steinkel |
you can clone the repo to another folder too and try running the tests isolated from your app |
# |
Jun 16th 2021, 08:08 |
steinkel |
plugin tests should run OK from the plugin itself |
# |
Jun 16th 2021, 08:08 |
rudy1976s |
@steinkel let me try one sec |
# |
Jun 16th 2021, 08:08 |
steinkel |
if you cd to vendor/x/Blog and run the testsuite from inside of the plugin? |
# |
Jun 16th 2021, 08:08 |
rudy1976s |
```<testsuite name="Blog"> <directory>./vendor/CMSGreen/Blog/tests/TestCase/</directory> </testsuite>``` |
# |
Jun 16th 2021, 08:07 |
rudy1976s |
I have setup the testsuite in the related section of the phpunit.xml |
# |
Jun 16th 2021, 08:07 |
rudy1976s |
the error is the following: `Referenced fixture class "Blog\Test\Fixture\PagesFixture" not found. Fixture "plugin.Blog.Pages" was referenced in test case "Blog\Test\TestCase\Model\Table\PagesTableTest".` In [/var/www/acme/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureManager.php, line 228] |
# |
Jun 16th 2021, 08:06 |
rudy1976s |
I am running the test using the following command : phpunit --testsuite Blog ( Blog is the name of the plugin located in vendor) |
# |
Jun 16th 2021, 08:05 |
steinkel |
how are you running the tests and what's your specific error please? |
# |
Jun 16th 2021, 08:04 |
rudy1976s |
Thank you ! |
# |
Jun 16th 2021, 08:04 |
rudy1976s |
Am I forgetting something ? |
# |
Jun 16th 2021, 08:03 |
rudy1976s |
I have added the testuite block in the phpunit.xml |