# |
Dec 28th 2018, 14:13 |
G00DSP33D |
Alas it wasn't :p |
# |
Dec 28th 2018, 14:13 |
challgren |
Ive learned that the hard way |
# |
Dec 28th 2018, 14:13 |
challgren |
It only causes nightmares if your code isnt DRY |
# |
Dec 28th 2018, 14:13 |
G00DSP33D |
Yes, testing is something we never did in our current iteration of the CMS, and it has caused some nightmares along the way. |
# |
Dec 28th 2018, 14:12 |
G00DSP33D |
Right now we're in the research phase, trying to soak in as much as possible information about 3.x, ensuring that we can rebuild every feature in the best and most flexible way available. |
# |
Dec 28th 2018, 14:12 |
challgren |
Also I would highly recommend writing testcases |
# |
Dec 28th 2018, 14:11 |
G00DSP33D |
Aha, finally I can say for once that we know this one and are planning to use it during the migration :D ... |
# |
Dec 28th 2018, 14:10 |
challgren |
Along with https://github.com/dereuromark/upgrade |
# |
Dec 28th 2018, 14:09 |
challgren |
https://github.com/dereuromark/cakephp-shim may help a bit too |
# |
Dec 28th 2018, 14:08 |
G00DSP33D |
Awesome, thanks again for sharing this. |
# |
Dec 28th 2018, 14:08 |
G00DSP33D |
Great! I've reserved some time this weekend to set up a first proof-of-concept, but will have to do some reading in the Cook book. But your hint might save me some time. Based on my initial findings I though it would be more complex. |
# |
Dec 28th 2018, 14:07 |
challgren |
Depends on your layout @rightscoreanalysis |
# |
Dec 28th 2018, 14:06 |
rightscoreanalysis |
in there a cake/book way to set a page title in cake3? |
# |
Dec 28th 2018, 14:05 |
challgren |
https://stackoverflow.com/questions/30845997/how-to-generate-sql-function-calls-with-the-cakephp-query-builder |
# |
Dec 28th 2018, 14:05 |
challgren |
So I did more research and you can just use $query->newExp() to use your native json sql functions |
# |
Dec 28th 2018, 14:02 |
G00DSP33D |
should I take a look at anything? |
# |
Dec 28th 2018, 14:00 |
G00DSP33D |
yes I am |
# |
Dec 28th 2018, 13:46 |
challgren |
vendor/bin/phpunit tests/TestCase/Mailer |
# |
Dec 28th 2018, 13:45 |
challgren |
@g00dsp33d you around still? |
# |
Dec 28th 2018, 13:24 |
challgren |
If you do make custom functions Im sure the community could benefit from then and you could do a PR to get them added or make a plugin |
# |
Dec 28th 2018, 13:24 |
G00DSP33D |
Thanks again a million for all the help and ideas both to challgren and admad. If you're interested, I'll report back with the final setup we'll go for. If we can share any code, also will do so. |
# |
Dec 28th 2018, 13:24 |
challgren |
My guess is 4.x will break it? |
# |
Dec 28th 2018, 13:23 |
admad |
should only need updating deprecated methods and such if you do want to use it |
# |
Dec 28th 2018, 13:23 |
challgren |
Ahh ok I was going to go down the STI road and was going to UseMuffin |
# |
Dec 28th 2018, 13:22 |
admad |
@challgren highly doubt anyone is using the muffin one, it has been updated in ages :slightly_smiling_face: |
# |
Dec 28th 2018, 13:22 |
G00DSP33D |
Yep, same here, always tried to avoid that and use the pure ORM features in Cake. But these could be the ideal compromise for us. |
# |
Dec 28th 2018, 13:21 |
challgren |
You would have to define custom SQL function which I honestly havent gotten into yet |
# |
Dec 28th 2018, 13:21 |
G00DSP33D |
But since we don't want to overlook anything, we're definitely going to look in all the suggestions you've made. |
# |
Dec 28th 2018, 13:21 |
G00DSP33D |
I will be honest. The way we set up fields and validate data is perfect for us, it's really fast. Just the querying is a nightmare. So if we can use the SQL functions as you suggested earlier with true JSON fields, we would be all set. |
# |
Dec 28th 2018, 13:21 |
challgren |
@admad UseMuffin not good to use anymore? |
# |
Dec 28th 2018, 13:20 |
admad |
https://github.com/robotusers/cakephp-table-inheritance |
# |
Dec 28th 2018, 13:20 |
G00DSP33D |
But we'll look into it, thanks for the suggestion. |
# |
Dec 28th 2018, 13:20 |
challgren |
https://github.com/UseMuffin/Sti |
# |
Dec 28th 2018, 13:20 |
G00DSP33D |
Nope I must admit |
# |
Dec 28th 2018, 13:19 |
challgren |
Have you explored STI? |
# |
Dec 28th 2018, 13:18 |
G00DSP33D |
That can vary. The smalles project we have, has about 3. The largest one has around 16 if I remember correctly. |
# |
Dec 28th 2018, 13:18 |
challgren |
how many different page types? |
# |
Dec 28th 2018, 13:17 |
G00DSP33D |
Less than 20 :D |
# |
Dec 28th 2018, 13:17 |
challgren |
How many tables do you have in your database? |
# |
Dec 28th 2018, 13:16 |
G00DSP33D |
Check the 'dyn_fields' key. We simply retrieve that array in the beforeValidate, and all those rules to the validator of the Page model. After validation we remove them, and in the beforeSave callback we serialize the data into JSON. |
# |
Dec 28th 2018, 13:14 |
G00DSP33D |
Just to give you a better idea, here's our Pages CakePHP configure for a homepage in our system. https://pastebin.com/0vLqqTqx |