Error on users profile page after update to 3.x.x:Error in render: "TypeError: Cannot read property 'map' of null"
mauthi opened this issue · 11 comments
This is a bug.
Prerequisites
- Are you running the latest version?
- Are you reporting to the correct repository?
- Did you check the documentation?
- Did you perform a cursory search?
Description
After opening the profile page (/administration/users/xx
) of a user I get the following error:
Did I miss something during update?
(Everything else worked fine with changelog!! Great work!!!)
Any update here - error still exists?
Not able to reproduce, but I'll release v.3.3.0 soon anyway. Leave this open until then.
Sorry, missed your comment. Will test it now.
Error still exists in 3.3.3
apparently the problem is in here
could you add a console.log
and see what goes wrong?
replace
export default (date, formatStr = null) => format(
(typeof date === 'string') ? parseISO(date) : date,
unicode2PHP(formatStr || store.state.meta.dateFormat),
{ locale: i18n[store.state.preferences.global.lang] },
);
with
export default function (date, formatStr = null) {
format(
(typeof date === 'string') ? parseISO(date) : date,
unicode2PHP(formatStr || store.state.meta.dateFormat),
{ locale: i18n[store.state.preferences.global.lang] },
);
}
and see if the 3 params that format is receiving are ok.
I did this and I think I found the problem:
My code:
export default function (date, formatStr = null) {
console.log("date: "+date + " | formatStr: "+formatStr);
console.log("unicode2PHP: "+unicode2PHP(formatStr || store.state.meta.dateFormat))
return format(
(typeof date === 'string') ? parseISO(date) : date,
unicode2PHP(formatStr || store.state.meta.dateFormat),
{ locale: i18n[store.state.preferences.global.lang] },
);
}
Output:
date: 1985-09-11 00:00:00 | formatStr: d.m.Y
unicode2PHP:
Problem is, that unicode2PHP()
can't handle dots as separator. I tried to fix this but I was not able to do it :(
If I change formatStr to e.g. d-m-Y
everything works like expected.
@aocneanu do you have an idea how to solve this? Otherwise I'm going to debug unicode2PHP()
?
Didn't had time to look at it. Of course that any help is appreciated :)
OK, I will try my best - but not today... If you find time earlier feel free to solve this (I think you will need 1-2 Minutes :))
closed with commit to related issue