留言板

6.2 GA4 - New User Expando Values not in table

thumbnail
William Gosse,修改在8 年前。

6.2 GA4 - New User Expando Values not in table

Liferay Master 帖子: 533 加入日期: 10-7-4 最近的帖子
I have a set of custom fields added to user and some have default values. I then created a new user programatically using the API. When I view my new user in the control panel everything looks good, including the default values I gave for the custom fields. However when I look for my user in in the expandovalue table my new user's data is not there. I had to save the user in the control panel to make the data would show up in the table. This not what I was expecting. Can some one tell what's going on? Where is the custom field data in the control panel coming from before I do the save?
thumbnail
Olaf Kock,修改在8 年前。

RE: 6.2 GA4 - New User Expando Values not in table

Liferay Legend 帖子: 6396 加入日期: 08-9-23 最近的帖子
Just a guess: As long as the value is the default value (e.g. has never been set) it's fine not to have it in the database? When you just create a user through the API, no custom values are set (unless you explicitly do so), but the UI fetches the default value for the user's profile.

Save the data from the profile and this explicitly saves everything, including the custom fields - voila.

You shouldn't look at the database anyway... ;)
thumbnail
William Gosse,修改在8 年前。

RE: 6.2 GA4 - New User Expando Values not in table (答复)

Liferay Master 帖子: 533 加入日期: 10-7-4 最近的帖子
I fix this by programatically adding the custom field values with the expando API when I add the user. I think if there's custom fields associated with user they should be added to the expando values table automatically when a new user is created. Its some what misleading to see custom filed values associated in the control panel but to be able to access them with the API.. The only way I figured that out was by looking at the database.
thumbnail
David H Nebinger,修改在8 年前。

RE: 6.2 GA4 - New User Expando Values not in table

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
Yeah, but imagine a system with 5+ mil users most of which relying upon default values...

All of those records in expando table w/o any real need.

My guess is you only noticed this because you're looking directly into the DB and, as we all should know, we should never ever be doing this....
thumbnail
Samujjwal Sahu,修改在8 年前。

RE: 6.2 GA4 - New User Expando Values not in table

Junior Member 帖子: 31 加入日期: 12-5-22 最近的帖子
I am facing the similar thing for my 100s of sites. We have several custom fields associated with site. And we read the values of the custom fields from the theme. Now as and when we create a site the custom fields are not stored in the database tables with the default values. So I decided to use groovy script to add those custom fields related entries with default values into the database.
So needed your help, on how did you programatically added the custom fields into the database for a particular user?
I need to do the same thing for my site.

Is there a way to fetch all the site specific Custom fields name using some liferay API?

Any help is highly appreciated.

Thanks & Regards
Samujjwal (Sam)
thumbnail
Samujjwal Sahu,修改在8 年前。

RE: 6.2 GA4 - New User Expando Values not in table

Junior Member 帖子: 31 加入日期: 12-5-22 最近的帖子
Was able to resolve the issue. With expando API as mentioned above. the concerned db tables are ExplandoTable, ExpandoRow, ExpandoColumn and ExpandoValue. Each have their own LocalServiceUtil class respectively in liferay api. Using which one can add values for a particular custom field.
thumbnail
William Gosse,修改在7 年前。

RE: 6.2 GA4 - New User Expando Values not in table

Liferay Master 帖子: 533 加入日期: 10-7-4 最近的帖子
I'm sorry I missed your question about this thread. I did use the Expando API to do to it. If you still need help I can add the code that used as well.