Log message #4141726

# At Username Text
# May 17th 2018, 13:47 jeremyharris I usually test the component directly
# May 17th 2018, 13:47 flavius @jeremyharris got a question for you, I'm a noob at unit testing, say i want to test a component, do i need to make a test app which loads said component or can i just go through that component code if statement by if statement, for 100% coverage?
# May 17th 2018, 13:45 jeremyharris so replace $this with $routes I think
# May 17th 2018, 13:45 jeremyharris that was copy/pasted from the routes
# May 17th 2018, 13:45 sibusiso_slack Thanks @jeremyharris, I will implement this in the controller. It throws all kinds of errors when I try to do it in the routes.php config file.
# May 17th 2018, 13:37 jeremyharris (those are the fallbacks that are set with `->fallbacks()`
# May 17th 2018, 13:37 jeremyharris if you are using DashedRoute as your default route, then you’ll only need to add ``` $this->connect('/:controller', ['action' => 'index'])->setHost('app.domain.test'); $this->connect('/:controller/:action/*')->setHost('app.domain.test'); ```
# May 17th 2018, 13:36 jeremyharris @sibusiso_slack the easiest solution might be to just implement the fallbacks yourself and set their hosts
# May 17th 2018, 13:22 slackebot Please could someone help me here. I need to match the fallback routes in a subdomain. How do I do this correctly?
# May 17th 2018, 13:22 sibusiso_slack File uploaded https://cakesf.slack.com/files/UARLT8J5B/FASDYCRM4/route_config.php / https://slack-files.com/T053DPNCM-FASDYCRM4-a3fcfeb129 - Good day,
# May 17th 2018, 13:04 jeremyharris heh thanks
# May 17th 2018, 13:04 birdy247 This @admad was pointing at me ;), your a good egg @jeremyharris
# May 17th 2018, 13:03 jeremyharris I’ll keep that in mind ;)
# May 17th 2018, 13:03 admad most questions asked in here have pretty simple solutions :slightly_smiling_face:
# May 17th 2018, 13:02 jeremyharris it’s true haha
# May 17th 2018, 13:02 admad you think too much :P
# May 17th 2018, 13:01 jeremyharris guess I misunderstood when you said ajax — didn’t know you were using json, thought you were using customized logic that utilized the _serialize var
# May 17th 2018, 13:00 birdy247 @admad such simple solutions :slightly_smiling_face:
# May 17th 2018, 12:59 admad let requesthandler auto set it to jsonview to set to jsonview yoursefl
# May 17th 2018, 12:58 admad don't set view class to MyAppView for ajax/json requests
# May 17th 2018, 12:58 birdy247 so presumably I am missing something
# May 17th 2018, 12:58 birdy247 but if I detach my own AppView class, it works
# May 17th 2018, 12:58 birdy247 right
# May 17th 2018, 12:57 admad view paths are irrelevant if you want the view to return serialized data. Having that error means JsonView is not being used for the request
# May 17th 2018, 12:57 jeremyharris some of the paths might be empty until it sets them there, unless you’re setting them explicitly or a component (request handler) is
# May 17th 2018, 12:56 jeremyharris Controller:render is your best bet I think
# May 17th 2018, 12:55 birdy247 @jeremyharris How do I see the paths from the viewBuilder() ?
# May 17th 2018, 12:54 jeremyharris you might have to debug at Controller::render to make sure you have all the info, as some of it is set there
# May 17th 2018, 12:52 jeremyharris second, I would debug the view builder right when it’s rendering to figure out what paths it’s using
# May 17th 2018, 12:52 jeremyharris AppView is your app view, for one
# May 17th 2018, 12:51 birdy247 Is there something in the _paths?
# May 17th 2018, 12:51 birdy247 I dont have templates, instead I use the _serialize response
# May 17th 2018, 12:51 birdy247 however, my ajax call are now always giving a 500 error about a missing template
# May 17th 2018, 12:50 birdy247 works well
# May 17th 2018, 12:50 birdy247 I have made my own MyAppView which extends AppView
# May 17th 2018, 12:05 lorenzo yes
# May 17th 2018, 11:41 Lopa can we use maria db with cakephp 2.9
# May 17th 2018, 10:32 dereuromark for now you can just use a custom lib class and done. refactoring will be easy.
# May 17th 2018, 10:31 dereuromark I tried the service layer plugin linked from burzum, it works nicely here: https://github.com/burzum/cakephp-service-layer He should tag a 0.1 release IMO
# May 17th 2018, 10:29 turkles thanks @dereuromark - but some of that is a little over my head and it looks like a discussion for future changes? Are there any examples you can think of in plugins I can look at for the service layer you mention?
# May 17th 2018, 10:11 rudy1976s but when I check the query which gives me that error it is an insert query