# |
Feb 19th 2020, 23:03 |
ndm |
I mean, the property name should by default be `creator`, shouldn't it? Anyhow... is there a stacktrace for that? (which basically means to do you have xdebug installed/enabled?) |
# |
Feb 19th 2020, 22:59 |
wizardfix |
Line 466 in Association.php is `$this->_targetTable = $tableLocator->get($registryAlias, $config);` and line 126 of Configure.php is the return statement of this function: ```public static function read($var = null, $default = null) { if ($var === null) { return static::$_values; } return Hash::get(static::$_values, $var, $default); }``` |
# |
Feb 19th 2020, 22:55 |
slackebot |
536870912 bytes exhausted (tried to allocate 262144 bytes) in /opt/lampp/htdocs/trportal/vendor/cakephp/cakephp/src/ORM/Association.php on line 466 Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in /opt/lampp/htdocs/trportal/vendor/cakephp/cakephp/src/Core/Configure.php on line 126``` Is this a bug in Cake or have I just got the syntax wrong? :thinking_face: |
# |
Feb 19th 2020, 22:55 |
wizardfix |
(3.8) Hmmm... Trying to set an association in my `UsersTable`: each `User` has a `created_by` field, which is a foreign key that self-references the `UsersTable.` `I have` ```$this->belongsTo('Creators') ->setClassName('Users') ->setForeignKey('created_by');``` but every time I add `->setPropertyName('creator');` to this, so I can reference `$user->creator->name` in my view, I get ``` Fatal error: Allowed memory size of |
# |
Feb 19th 2020, 22:54 |
ricksaccous |
anyway, thanks, cheers |
# |
Feb 19th 2020, 22:50 |
ricksaccous |
so whatever i do in my appController is for naught in that case |
# |
Feb 19th 2020, 22:49 |
ricksaccous |
yeah it's prob the less hacky way anyway, i suppose that the plugin calls parent::beforeRender after it sets the layouts and that's what's causing this, I believe it inherits my appController |
# |
Feb 19th 2020, 22:47 |
ndm |
Generally there's nothing wrong with overriding plugin templates. Depending on the template you might be able to extend it and add your css. |
# |
Feb 19th 2020, 22:46 |
ricksaccous |
even though it's gross |
# |
Feb 19th 2020, 22:45 |
ricksaccous |
that seems to be working... |
# |
Feb 19th 2020, 22:43 |
ricksaccous |
but i might just do it by over-riding all templates and see if that works |
# |
Feb 19th 2020, 22:43 |
ricksaccous |
to the layout |
# |
Feb 19th 2020, 22:43 |
ricksaccous |
all i want to do is add a css file |
# |
Feb 19th 2020, 22:43 |
ricksaccous |
interesting |
# |
Feb 19th 2020, 22:42 |
ndm |
Well, it's hard to tell without knowing exactly what the plugin does and how it might be configurable, but generally this could for example be solved by changing event priorities, so that your `beforeRender` event is being triggered last. |
# |
Feb 19th 2020, 22:39 |
ricksaccous |
that layout over-rides what i set in my beforeRender |
# |
Feb 19th 2020, 22:39 |
ricksaccous |
and it sets a layout |
# |
Feb 19th 2020, 22:39 |
ricksaccous |
the plugin's beforeRender has $this->viewBuilder()->setLayout(); |
# |
Feb 19th 2020, 22:37 |
ndm |
Where and how is it being overriden? |
# |
Feb 19th 2020, 22:35 |
ricksaccous |
I'm setting layout ($this->viewBuilder()->setLayout('some_layout')) |
# |
Feb 19th 2020, 22:35 |
ricksaccous |
can i do anything about that? |
# |
Feb 19th 2020, 22:35 |
ricksaccous |
and it over-rides what i'm setting |
# |
Feb 19th 2020, 22:34 |
ricksaccous |
suppose i have code that runs after my beforeRender, plugin code |
# |
Feb 19th 2020, 20:50 |
rightscoreanalysis |
I figured it |
# |
Feb 19th 2020, 20:45 |
rightscoreanalysis |
I don't understnad how the redirect is happening to "login' without config. I nuked my cache btw |
# |
Feb 19th 2020, 20:44 |
rightscoreanalysis |
I discovered this by negatively testing my unauthiorized redirect that seemingly was not working as I wanted |
# |
Feb 19th 2020, 20:44 |
rightscoreanalysis |
when I access unauthorized routes I still get reduirected to 'login' |
# |
Feb 19th 2020, 20:43 |
rightscoreanalysis |
can anyone help me to understand how auth redirects work. I removed all config from my TinyAuth setup in AppController |
# |
Feb 19th 2020, 17:24 |
ricksaccous |
nevermind i think i can just do that via controller |
# |
Feb 19th 2020, 17:20 |
ricksaccous |
over-ride layouts? |
# |
Feb 19th 2020, 17:20 |
ricksaccous |
can i |
# |
Feb 19th 2020, 17:15 |
neon1024 |
Wouldn’t you override the template and change the element being rendered? |
# |
Feb 19th 2020, 17:12 |
ricksaccous |
is it possible to over-ride elements rather than templates? |
# |
Feb 19th 2020, 17:12 |
ricksaccous |
https://book.cakephp.org/3/en/plugins.html#overriding-plugin-templates-from-inside-your-application |
# |
Feb 19th 2020, 16:56 |
neon1024 |
Using `array_merge` was all I could think of. `array_merge(['thing' => 0, 'other' => 0], $counted->toArray())` |
# |
Feb 19th 2020, 16:55 |
neon1024 |
`countBy` obviously doesn’t create a key if the count is 0 |
# |
Feb 19th 2020, 16:55 |
neon1024 |
When using `countBy` is there a way to set defaults, so keys always exist, and count as 0 |
# |
Feb 19th 2020, 15:31 |
dereuromark |
hah, wrote a small check script that found that all the rest of the tables were ok. https://github.com/dereuromark/cakephp-setup/commit/f1ae1953fd70f8c2ab3241146e9dc4d0e8ba04d8 Only that one issue was left. |
# |
Feb 19th 2020, 15:13 |
dereuromark |
hehe |
# |
Feb 19th 2020, 15:08 |
admad |
If you can undo it means you never removed the data in the first place :P |
# |
Feb 19th 2020, 14:48 |
spriz |
Yeah but good luck explaining that to a confused user :) :) |