octobercms / october

Self-hosted CMS platform based on the Laravel PHP Framework.
https://octobercms.com/
Other
11.03k stars 2.21k forks source link

Uncaught TypeError: Cannot read property '0' of undefined #2227

Closed leocavalcante closed 8 years ago

leocavalcante commented 8 years ago
Expected behavior

Date picker widget to show up next to the input.

Actual behavior

It doesn't appear and the following errors shows up at the console on every click:

storm-min.js?v349:2380 Uncaught TypeError: Cannot read property '0' of undefined

Time picker seams all right, its only for the dates.

Reproduce steps

Just add a datepicker field with any mode.

October build

349

daftspunk commented 8 years ago

Unable to reproduce. This might be a single user issue. Do you have another October installation you can test with?

jepp112 commented 8 years ago

This is happening to me too. I have used Builder to develop a plugin maybe is Builder related error.

leocavalcante commented 8 years ago

I'm not using Builder on this project, it is using Translate, Editable and User. Haven't time yet, but I'll hack a little more into this to get more info.

jepp112 commented 8 years ago

I cleared the cache and logout from the system. I 'm not sure if this did the trick but it is working now.

leocavalcante commented 8 years ago

Hm! I did a clean install, added the same plugins and it's working. Probably something with my project. I will reopen if I find anything else.

leocavalcante commented 8 years ago

Weird, something about the Locale. I switched back to en then set again to pt-BR and its working now :confused:

daftspunk commented 8 years ago

Code shows it is looking for a locale that doesn't exist in pikaday

opts.i18n.months[i]+'</option>');}

We will update it today and hopefully that improves the locale support.

Refs #2237

daftspunk commented 8 years ago

I noticed da was missing locale information. It was compiled in 5af9fcbfdcc1c163f0113a1df7adbe03b3cd3bdf

This might have been the cause.

ekstremedia commented 7 years ago

I have the same issue on build 419. Was also missing a language file, made the missing file, but still get one error: storm-min.js?v419:2395 Uncaught TypeError: Cannot read property '0' of undefined.

Edit: Apparently my language was set to Bali in the backend, hehe, dont know how that happened! Set it back to Norwegian, now it works again.

r-guimaraes commented 6 years ago

I know that you guys have already found the solution, but just complementing ...

I set the locale to "Brazil", and timezone to "America/Sao_Paulo" (because obviously that was just my case) at "Profile > Back-end preferences", and that did the trick

Thanks for the answers above

CasonWebDev commented 5 years ago

Is too late to anwser that, but, i got the error only now, and i solved changing pt-BR to pt-br, is stupid i know, but, i think this is the cause ahahaha

bennothommo commented 5 years ago

@CasonWebDev Never too late to add any answers. If anyone has the same issue, hopefully they'll come across this issue and your answer ;)

boyardnicolas commented 3 years ago

@bennothommo I had the same issue with Pikaday and this post helped find the root cause, which now I remember already happened to me before (don't remember if same context or not). Every time I create a new user it seems that no language is picked. 1 - on the user settings page, Bahasa Indonesia language is shown, but probably because nothing is selected and Bahasa is the first option of the select list. 2 - the interface is in English even if the browser/system language is not, so I guess it's because the CMS default language is English 3 - when pikaday is trying to display the calendar, it relies on user's picked language, which is undefined, causing the bug

Should I open a new issue for this? Would be nice to automatically set the language to browser's language upon login if no language has been enforced in user settings (or force new users to pick a language as soon as they login).

daftspunk commented 3 years ago

@boyardnicolas Yes, new issue and we can look in to it

boyardnicolas commented 3 years ago

@daftspunk Done, thank you

5576