# |
Jul 5th 2017, 16:30 |
jeremyharris |
what happens if you do $this->Files->get(‘eec8af26-c4e7-463d-ad60-3712b1f9dd90’) |
# |
Jul 5th 2017, 16:29 |
jeremyharris |
and you’re certain that those IDs have data in them? they’re not remnants of previous tests? |
# |
Jul 5th 2017, 16:28 |
pedroseco |
all null but they are not null on the database and only show like this if from a contain find |
# |
Jul 5th 2017, 16:28 |
pedroseco |
check in the files array. |
# |
Jul 5th 2017, 16:28 |
pedroseco |
@jeremyharris ok so this is the json result of the Post find with Contain Files https://gist.github.com/pedroseco/b36a3d76c0a66e37af8b8986f1cee017 |
# |
Jul 5th 2017, 16:26 |
jeremyharris |
check the sql log, it may just always be using ORDER Properties.id ASC every time. if so, remove the ->order from your query to allow the paginator to do the sorting |
# |
Jul 5th 2017, 16:25 |
jeremyharris |
oh wait it looks like you already have an ->order clause. I don’t remember if it removes that, perhaps remove that |
# |
Jul 5th 2017, 16:24 |
jeremyharris |
did you first try removing the whitelist entirely? |
# |
Jul 5th 2017, 16:23 |
jarard01 |
it still won't sort - I don't get it |
# |
Jul 5th 2017, 16:22 |
jeremyharris |
I’m not following. can you gist the whole find() along with the result array? |
# |
Jul 5th 2017, 16:21 |
pedroseco |
(they are filled on the database.) |
# |
Jul 5th 2017, 16:21 |
pedroseco |
yup it returns null fields only id / created / modified on Files are !empty. |
# |
Jul 5th 2017, 16:20 |
jeremyharris |
maybe I’m not understanding :slightly_smiling_face: |
# |
Jul 5th 2017, 16:20 |
jeremyharris |
@pedroseco and that result doesn’t contain all the post data? |
# |
Jul 5th 2017, 16:20 |
jeremyharris |
jarard01 if you want to allow anything to be used for sorting (except contains) then you don’t need the whitelist |
# |
Jul 5th 2017, 16:20 |
pedroseco |
its a simple $this->Posts->find()->where(xxx)->contain([Files]). were you talking about the result? |
# |
Jul 5th 2017, 16:20 |
jarard01 |
I also read the whiteListing is only required for virtual fields and related models? |
# |
Jul 5th 2017, 16:19 |
jarard01 |
jeremyharris, I just edited controller and view to both only use the field name, it still doesn't work |
# |
Jul 5th 2017, 16:19 |
jeremyharris |
can you gist your find? |
# |
Jul 5th 2017, 16:18 |
pedroseco |
@jeremyharris sorry to bother you again, but i was trying to read the data that I saved before on the joinTable but the $post find with contain(Files) returns the records but they just contain the ID. Do you know if its necessary to do something else to read the rest of the record? |
# |
Jul 5th 2017, 16:17 |
jeremyharris |
posted |
# |
Jul 5th 2017, 16:15 |
jeremyharris |
(answering) |
# |
Jul 5th 2017, 16:15 |
jarard01 |
https://stackoverflow.com/questions/44928493/cake3-paginator-sort-error |
# |
Jul 5th 2017, 16:14 |
jeremyharris |
and what field you are trying to paginate |
# |
Jul 5th 2017, 16:14 |
jeremyharris |
specifically the paginator setup |
# |
Jul 5th 2017, 16:14 |
jeremyharris |
do you have a gist I can see? |
# |
Jul 5th 2017, 16:14 |
jeremyharris |
nah it has affected other users who use apache. I haven’t read through the who PHP bug itself though https://bugs.php.net/bug.php?id=74833 |
# |
Jul 5th 2017, 16:14 |
jarard01 |
jeremyharris, any idea regarding ym paginator sort issue? |
# |
Jul 5th 2017, 16:13 |
jarard01 |
likely my low quality WAMP setup |
# |
Jul 5th 2017, 16:13 |
jeremyharris |
check out the issue, it’s a PHP bug unfortunately |
# |
Jul 5th 2017, 16:12 |
jarard01 |
and now it has disappeared |
# |
Jul 5th 2017, 16:12 |
jarard01 |
i simply updated a field |
# |
Jul 5th 2017, 16:12 |
jeremyharris |
jarard01: https://github.com/cakephp/chronos/issues/147 |
# |
Jul 5th 2017, 16:11 |
jarard01 |
wow - out of the blue: Fatal error: Class Cake\Chronos\Chronos contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (DateTimeInterface::format, DateTimeInterface::) |
# |
Jul 5th 2017, 15:44 |
neon1024 |
Or use h(), then you can see the tags as text :slightly_smiling_face: |
# |
Jul 5th 2017, 15:44 |
rudy1976s |
thank you all |
# |
Jul 5th 2017, 15:44 |
rudy1976s |
I will make some test , it should come from a textarea |
# |
Jul 5th 2017, 15:43 |
neon1024 |
Or try wrapping it with strip_tags() |
# |
Jul 5th 2017, 15:43 |
jeremyharris |
does description have html in it? if so, you’ll want to add ‘html’ => true in the options array |
# |
Jul 5th 2017, 15:43 |
rudy1976s |
yes so I need to understand why on my side :scream: it does |
# |
Jul 5th 2017, 15:42 |
jeremyharris |
it doesn’t add a p tag if that’s your question |