<![CDATA[ ClassExtender - MyExtUserSchema - My Forums]]> https://forums.modx.com/thread/?thread=104968 <![CDATA[ClassExtender - MyExtUserSchema]]> https://forums.modx.com/thread/104968/classextender---myextuserschema#dis-post-564420
https://bobsguides.com/classextender-class.html

When you first run ClassExtender you edit the following chunks and then run the 'Extend modUser' snippet.

  • MyExtUserSchema
  • MyExtraUserFields

This process creates the 'ext_user_data' table into which all of your specified fields are added.

My (very simplistic) understanding is that the 'MyExtUserSchema' chunk is responsible for the table and field creation in the MODX database and the 'MyExtraUserFields' chunk creates the fields in your User admin area. I know it does some other magic.

If you subsequently need to add more fields to the table it is necessary to add the fields directly to the 'ext_user_data' table using either the command line or something like phpMyAdmin as 'Extend modUser' will not alter an existing 'ext_user_data' table.

So, after a rather long introduction, my actual question is:

When adding additional fields after the initial run of 'Extend modUser', if I add my fields directly into my 'ext_user_data' table and then run the 'Extend modUser' again do I need to add those additional fields to the 'MyExtUserSchema' chunk, or is it sufficient add them only to the 'MyExtraUserFields' chunk.

MODX: 2.7.1
PHP: 7.2.13
ClassExtender: 2.1.0pl
]]>
andytough Mar 13, 2019, 04:38 PM https://forums.modx.com/thread/104968/classextender---myextuserschema#dis-post-564420
<![CDATA[Re: ClassExtender - MyExtUserSchema]]> https://forums.modx.com/thread/104968/classextender---myextuserschema#dis-post-564431 andytough Mar 13, 2019, 07:55 PM https://forums.modx.com/thread/104968/classextender---myextuserschema#dis-post-564431 <![CDATA[Re: ClassExtender - MyExtUserSchema]]> https://forums.modx.com/thread/104968/classextender---myextuserschema#dis-post-564428
Even if you changed the schema and re-submitted the form, double check to make sure the class file refers to the new fields.]]>
BobRay Mar 13, 2019, 06:41 PM https://forums.modx.com/thread/104968/classextender---myextuserschema#dis-post-564428
<![CDATA[Re: ClassExtender - MyExtUserSchema]]> https://forums.modx.com/thread/104968/classextender---myextuserschema#dis-post-564425
It doesn't seem to add fields to the db when run a second time. So I have been adding them with phpMyAdmin before running.

However your comment but it should update the class and map files suggests that just adding the fields via phpMyAdmin is not enough and that 'MyExtUserSchema' does do some important additional work.

I will carry on with my current procedure of adding fields with phpMyAdmin, and updating both MyExtUserSchema and MyExtraUserFields before viewing the Extend modUser resource and submitting the form.

I was just being lazy, thinking I might not have to MyExtraUserFields if I'd already created the fields manually!

Thank for your help. Andy]]>
andytough Mar 13, 2019, 05:22 PM https://forums.modx.com/thread/104968/classextender---myextuserschema#dis-post-564425
<![CDATA[Re: ClassExtender - MyExtUserSchema (Best Answer)]]> https://forums.modx.com/thread/104968/classextender---myextuserschema#dis-post-564423
I'm not sure if it will add the fields to the DB or not (I think it will), but it should update the class and map files.]]>
BobRay Mar 13, 2019, 05:10 PM https://forums.modx.com/thread/104968/classextender---myextuserschema#dis-post-564423