# |
Jul 20th 2017, 14:36 |
inoas |
is that how it is supposed to work? |
# |
Jul 20th 2017, 14:36 |
inoas |
but when doing so my previous serialization gets overwritten |
# |
Jul 20th 2017, 14:35 |
inoas |
I then also want to serialize something in beforeRender |
# |
Jul 20th 2017, 14:35 |
admad |
`$controller->viewBuilder()->templatePath() .= DS . $type;` ain't gonna work even in php 7 |
# |
Jul 20th 2017, 14:35 |
neon1024 |
Could eliminate a potential possibility though |
# |
Jul 20th 2017, 14:35 |
inoas |
I have a actions that serialize variables |
# |
Jul 20th 2017, 14:35 |
admad |
that aint gonna help if the problem is in app code :slightly_smiling_face: |
# |
Jul 20th 2017, 14:34 |
neon1024 |
`rm -rf vendor andand composer update andand bin/cake orm_cache build` #NukeItFromOrbit :P |
# |
Jul 20th 2017, 14:34 |
shuyi |
hmm, even weirder, ```PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 8192 bytes) in /vendor/composer/ClassLoader.php on line 444``` , I have my memory limit set to 1024MB in php.ini ... |
# |
Jul 20th 2017, 14:29 |
shuyi |
Let me try 7 |
# |
Jul 20th 2017, 14:28 |
hmic |
i bet on 7.x it runs ;) |
# |
Jul 20th 2017, 14:28 |
hmic |
the return values cannot be used in writecontext is an php error that got fixed/mitigated sometime ago IMHO |
# |
Jul 20th 2017, 14:28 |
neon1024 |
Would be my guess at least |
# |
Jul 20th 2017, 14:28 |
neon1024 |
It’ll be in AppController |
# |
Jul 20th 2017, 14:28 |
neon1024 |
You’ll have to assign the method return and concat the string afterwards |
# |
Jul 20th 2017, 14:28 |
neon1024 |
Because you can’t use `->templatePath()` as part of writing a variable |
# |
Jul 20th 2017, 14:27 |
shuyi |
php 5.6 |
# |
Jul 20th 2017, 14:27 |
hmic |
what version of php are you running? :O |
# |
Jul 20th 2017, 14:26 |
slackebot |
```$controller->viewBuilder()->templatePath() .= DS . $type;``` , I have no idea which class or line it came from, that is all the error message I am getting ... anyone encounter this before? thanks :S |
# |
Jul 20th 2017, 14:26 |
shuyi |
Hi guys, I am doing a migration from cake 2 to cake 3, and I have came across an error which google cannot find ... when I do bin/cake server, and then go to the link, this error pops out : ``` Fatal error: Can't use method return value in write context in src/Controller/Component/RequestHandlerComponent.php on line 594``` , the function name is ``` public function renderAs(Controller $controller, $type, $options = array()) { ```and that line |
# |
Jul 20th 2017, 14:18 |
mccp |
where might i find the problem then? |
# |
Jul 20th 2017, 14:17 |
admad |
your association config is fine. I aint gonna read whatever mess you have in controller :slightly_smiling_face: |
# |
Jul 20th 2017, 14:13 |
admad |
or better yet full PropertiesTable |
# |
Jul 20th 2017, 14:13 |
mccp |
https://gist.github.com/mccp/8b135e5556c57671ab17c756c9af34fa |
# |
Jul 20th 2017, 14:13 |
admad |
show your association config |
# |
Jul 20th 2017, 14:12 |
mccp |
but still can't |
# |
Jul 20th 2017, 14:12 |
mccp |
yes, i've set the db to nullable |
# |
Jul 20th 2017, 14:12 |
neon1024 |
If it’s baked :slightly_smiling_face: |
# |
Jul 20th 2017, 14:12 |
neon1024 |
It’d probably fail the Rules though |
# |
Jul 20th 2017, 14:12 |
admad |
make sure that column is nullable in db |
# |
Jul 20th 2017, 14:12 |
admad |
you can |
# |
Jul 20th 2017, 14:11 |
mccp |
if i have an PropertiesTable that belongsTo PropertyCategories, so can't I specify $property->property_category_id = null? |
# |
Jul 20th 2017, 14:11 |
hmic |
you cant save an associated entity without the entity it is associated with - makes sense, does it? |
# |
Jul 20th 2017, 14:10 |
hmic |
so you need to refer to another entity actually in your case |
# |
Jul 20th 2017, 14:10 |
hmic |
you cant? there is no way a primary key can be null |
# |
Jul 20th 2017, 14:10 |
mccp |
oh, wait, how can i allow it to be null? |
# |
Jul 20th 2017, 14:10 |
hmic |
so this is what it is |
# |
Jul 20th 2017, 14:09 |
mccp |
the error says it's null |
# |
Jul 20th 2017, 14:09 |
hmic |
you said its NULL |
# |
Jul 20th 2017, 14:09 |
mccp |
but the id i give it exists in database. |
# |
Jul 20th 2017, 14:04 |
hmic |
you are saving to an entity that does not exist |