# |
Dec 2nd 2019, 15:03 |
gianmarxgagliardi |
they are not like taking the fields of the other two tables from the dogs_cats controller |
# |
Dec 2nd 2019, 15:02 |
gianmarxgagliardi |
https://stackoverflow.com/questions/59141547/cakephp-displays-the-id-display-table-name-from-two-different-tables-with-relati |
# |
Dec 2nd 2019, 15:02 |
gianmarxgagliardi |
this would be the problem in detail |
# |
Dec 2nd 2019, 15:02 |
gianmarxgagliardi |
hi I should enter IDs from two tables and show the name in the view |
# |
Dec 2nd 2019, 14:39 |
dereuromark |
dunno, only did plugins so far, that worked out all right |
# |
Dec 2nd 2019, 14:37 |
maymeow |
or ... how hard is to upgrade whole app to Cakephp 4 :D |
# |
Dec 2nd 2019, 14:33 |
neon1024 |
..but you do lose the validation messages |
# |
Dec 2nd 2019, 14:33 |
neon1024 |
I tend to skip creating a whole widget and just manually write a tag |
# |
Dec 2nd 2019, 14:32 |
dereuromark |
See https://github.com/FriendsOfCake/bootstrap-ui/tree/master/src/View/Widget |
# |
Dec 2nd 2019, 14:32 |
alexmax |
That's good to hear that it's fixed in 4.x. Thanks for hipping me about the 3.x status, I can just swap a template on a text field, I just didn't know if there was a magic happy path that I hadn't seen in the documentation. |
# |
Dec 2nd 2019, 14:32 |
dereuromark |
Using custom widgets you can get this. |
# |
Dec 2nd 2019, 14:31 |
alexmax |
Oh I was scrolled up. |
# |
Dec 2nd 2019, 14:31 |
alexmax |
But from perusing the documentation it seems like the three-select is default, I don't see a way off-hand to generate HTML5 date inputs. |
# |
Dec 2nd 2019, 14:31 |
ndm |
It should generate that out of the box in CakePHP 4.x now. In 3.x you'd need a workaround, for example use `'type' => 'text'` and custom templates, or a custom datetime widget, or a custom form helper, or... |
# |
Dec 2nd 2019, 14:26 |
alexmax |
If you're saying that that is what you get out of the box, then I think maybe I have some form templates to rework. |
# |
Dec 2nd 2019, 14:26 |
alexmax |
Well, I can't figure out how to generate it. If I do `type => 'date'` from the form helper, it gives me three select dropdowns. What I'm looking for is literally `<input type="date">`. |
# |
Dec 2nd 2019, 14:25 |
dereuromark |
it should work out of the box for supporting browsers, and should display fallback string. make sure you have validation in place here. |
# |
Dec 2nd 2019, 14:24 |
dereuromark |
ah gotcha. whats your issue with this element? |
# |
Dec 2nd 2019, 14:24 |
alexmax |
@dereuromark Sorry for my terseness. By HTML5 datepicker, I mean a `type="date"` input tag. |
# |
Dec 2nd 2019, 14:22 |
maymeow |
hmm |
# |
Dec 2nd 2019, 14:20 |
dereuromark |
See https://github.com/dereuromark/cakephp-shim/pull/61 - still not resolved yet |
# |
Dec 2nd 2019, 14:20 |
dereuromark |
i know :slightly_smiling_face: |
# |
Dec 2nd 2019, 14:19 |
maymeow |
cakephp doing good but problem are tests (phpunit 6 is unsupported on 7.4.0) |
# |
Dec 2nd 2019, 14:18 |
dereuromark |
@alexmax That is vage. it depends on what css (framework) etc. I have apps that use the cake select dropdowns ( https://sandbox.dereuromark.de/sandbox/js-examples/datepicker ), but most usually prefer a string input field here. |
# |
Dec 2nd 2019, 14:17 |
dereuromark |
try it out |
# |
Dec 2nd 2019, 14:17 |
maymeow |
What about CakePHP and compatibility with php 7.4 Can i upgrade? |
# |
Dec 2nd 2019, 14:15 |
alexmax |
What is the intended way to create a form element that uses an HTML5 datepicker? |
# |
Dec 2nd 2019, 14:13 |
ndm |
If you look at the source, it seems that it cannot resolve an associated tables class name to a repository name. Inspecting the involved/generated values might help to figure where things are going wrong. https://github.com/FriendsOfCake/crud-json-api/blob/0.5.4/src/Schema/JsonApi/DynamicEntitySchema.php#L306-L309 https://github.com/FriendsOfCake/crud-json-api/blob/0.5.4/src/Schema/JsonApi/DynamicEntitySchema.php#L356 |
# |
Dec 2nd 2019, 14:03 |
noel |
The resolves to the CRUD `add` action, which I'm intercepting with crud's `beforSave` to do an associated insert (which succeeds) but then it seems to redirect or something. |
# |
Dec 2nd 2019, 14:01 |
noel |
It's cake 3.8.x |
# |
Dec 2nd 2019, 14:01 |
noel |
@dereuromark but the thing is that the URL that the request is being sent to resolves to a controller and actually successfully INSERT's a record. So I'm at a loss as to where why an empty route is being triggered and by what? |
# |
Dec 2nd 2019, 13:59 |
dereuromark |
otherwise the controller and plugin being empty string and not null is sure causing this. |
# |
Dec 2nd 2019, 13:58 |
dereuromark |
if that is cake4 |
# |
Dec 2nd 2019, 13:57 |
dereuromark |
prefix => Api (case sensitive) |
# |
Dec 2nd 2019, 13:56 |
slackebot |
/Users/noeldacosta/repo/mnr-be/vendor/neomerx/json-api/src/Representation/BaseWriter.php(182): Neomerx\JsonApi\Parser\IdentifierAndResource->parseLinks(Object(CrudJsonApi\Schema\JsonApi\DynamicEntitySchema), Object(App\Model\Entity\Enquiry), 'enquiry-type', Array, true, false)``` and it seems to be routing to a view (although it shouldn't as it's the CRUD action. |
# |
Dec 2nd 2019, 13:56 |
slackebot |
/Users/noeldacosta/repo/mnr-be/vendor/friendsofcake/crud-json-api/src/Schema/JsonApi/DynamicEntitySchema.php(309): Cake\Routing\Router::url(Array, false) #2 /Users/noeldacosta/repo/mnr-be/vendor/neomerx/json-api/src/Parser/RelationshipData/ParseRelationshipLinksTrait.php(117): CrudJsonApi\Schema\JsonApi\DynamicEntitySchema->getRelationshipSelfLink(Object(App\Model\Entity\Enquiry), 'enquiry-type') #3 |
# |
Dec 2nd 2019, 13:56 |
noel |
@ndm well the stacktrace is this: ```2019-12-02 13:53:33 Error: [Cake\Routing\Exception\MissingRouteException] A route matching "array ( 'controller' => '', 'plugin' => '', 0 => 1, '_method' => 'GET', 'action' => 'view', 'prefix' => 'api', '_ext' => NULL, )" could not be found. #0 /Users/noeldacosta/repo/mnr-be/vendor/cakephp/cakephp/src/Routing/Router.php(734): Cake\Routing\RouteCollection->match(Array, Array) #1 |
# |
Dec 2nd 2019, 13:52 |
alexdd55976 |
` hayko/mongodb dev-master` ran into version issues |
# |
Dec 2nd 2019, 13:52 |
alexdd55976 |
is there a mongodb plugin for cake4? |
# |
Dec 2nd 2019, 13:40 |
ndm |
Start with checking the stracktrace to figure where exactly the problem originates (presumably a call to `Router::url()` , either explicitly or implicitly (for example via a helper)), that might give some insight on what's happening. |
# |
Dec 2nd 2019, 13:37 |
slackebot |
'action' => 'view',\n 'prefix' => 'api',\n '_ext' => NULL,\n)\" could not be found." } ],``` Any idea why I'm getting a 404 saying route could not be found instead of the expected JSONAPI response after successful insert? |