Log message #4054748

# At Username Text
# Jul 20th 2017, 14:48 admad if you are american it could be the russians
# Jul 20th 2017, 14:48 jeremyharris better yet, debug($this->Form->control(‘…’)) to see exactly what it’s outputting
# Jul 20th 2017, 14:47 jeremyharris and JS
# Jul 20th 2017, 14:47 jeremyharris did you check your templates yet?
# Jul 20th 2017, 14:47 eBugg as per code
# Jul 20th 2017, 14:47 inoas urgh urgh
# Jul 20th 2017, 14:47 inoas urgh now $viewVars['_serialize'] doesnt necessarily exist
# Jul 20th 2017, 14:47 eBugg echo $this->Form->input('referencia', array('autofocus' => 'autofocus'));
# Jul 20th 2017, 14:46 eBugg admad: it was a failed edited copy/paste
# Jul 20th 2017, 14:46 shuyi you can just do $collection->addLast($x)
# Jul 20th 2017, 14:46 jeremyharris this is certainly a mystery :P
# Jul 20th 2017, 14:46 hmic inoas, just use + with arrays :p
# Jul 20th 2017, 14:46 admad so you definitely have a custom helper
# Jul 20th 2017, 14:46 shuyi i use laravel collection in cake, works like a charm
# Jul 20th 2017, 14:45 admad autofocus="autofocus" also never gets added automatically
# Jul 20th 2017, 14:45 jeremyharris is JS disabling it eBugg ?
# Jul 20th 2017, 14:45 inoas I liked am in 1.x ;)
# Jul 20th 2017, 14:45 eBugg I meant $this->Form->input('referencia');
# Jul 20th 2017, 14:45 inoas admad well array_merge/am is okay ... but array_push should just behave sane, or there should be one that does
# Jul 20th 2017, 14:45 jeremyharris is that in the same form? do either of the controls receive custom templates?
# Jul 20th 2017, 14:45 eBugg sorry
# Jul 20th 2017, 14:45 jeremyharris eBugg the form helper wouldn’t automatically add “disabled” — at least not that I’ve ever seen
# Jul 20th 2017, 14:45 eBugg like $this->Form->input('precio_directo_euro'); outputs: <input name="data[OperacionVenta][referencia]" autofocus="autofocus" maxlength="15" value="js-embalaje" id="OperacionVentaReferencia" required="required" type="text">
# Jul 20th 2017, 14:44 admad in 1.x we had am() as short for array_merge() :P
# Jul 20th 2017, 14:44 inoas sometimes php makes me cry
# Jul 20th 2017, 14:44 inoas sadly array_push works with references
# Jul 20th 2017, 14:44 shuyi I found the answer ... migration tool used cake 2 request handler component, and placed them inside controller/component, and it overwrote the cake3 request handler
# Jul 20th 2017, 14:43 admad yes
# Jul 20th 2017, 14:43 inoas array_merge
# Jul 20th 2017, 14:43 admad inoas: no, never use "+" for arrays with numeric keys
# Jul 20th 2017, 14:43 eBugg jeremyharris: AFAIK I don't use any extended helper... and it only happens with that one field. The other ones in the same form are fine.
# Jul 20th 2017, 14:42 inoas so thats the way to do it I assume $this->set(['locales' => $locales, '_serialize' => $this->viewVars['_serialize'] + ['locales']);
# Jul 20th 2017, 14:41 admad hmm maybe, i dont remember :slightly_smiling_face:
# Jul 20th 2017, 14:41 eBugg admad I think step comes from the attributes of the field in the DB
# Jul 20th 2017, 14:40 jeremyharris and custom widgets for that matter
# Jul 20th 2017, 14:40 jeremyharris eBugg look at your form templates, and any extended helper you might be using.
# Jul 20th 2017, 14:40 admad eBugg: the step="0.000001" is also not default. You probably have a custom formhelper with overridden methods
# Jul 20th 2017, 14:40 neon1024 Presumably that’s why the template is being changed based on the request :slightly_smiling_face:
# Jul 20th 2017, 14:39 neon1024 @shuyi The RequestHandler component wraps logic for dealing with requests, request headers, and such. Like returning json when a request has a Content-Type: application/json header
# Jul 20th 2017, 14:39 eBugg how do I get rid of the 'disabled' ?
# Jul 20th 2017, 14:39 eBugg I end up with this <input name="data[OperacionVenta][precio_directo_euro]" step="0.000001" id="OperacionVentaPrecioDirectoEuro" disabled="" type="number">