Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Update for critical security issue in PHPMailer included in release Vanilla 2.3.1
Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.


This discussion is related to the UserFields addon.
edited August 2009 in Vanilla 1.0 Help


  • Just as an example, to create a drop-down list of regions as a field for a user, put the following into the 'UserFieldOptions' field for the "Dropdown list" field type:

    item=ne:North East
    item=se:South East
    item=nw:North West
    item=sw:South West

    Eventually the options field will be replaced by another sub-form that uses the fields themselves to provide a multi-item key/value pair section, and two boolean items (checkboxes).

    I've been very careful to ensure data put into the tables is not simply put through serialize() for storage - the lazy way. This makes it much easier to subsequently use the data (for searching, joining and tweaking by hand).
  • Uploaded version 0.2.0 of UserFields.
  • New version uploaded with subversion folders stripped out.
  • Hello...

    I hope you can help me... I have installed your extension. On my screen there are the error-message

    "Err create userfield config"...
    Please Help me... Thank you...

    Sorry, my english is not so good...

    LG Nicole
  • Dear judgej Im using the last version of Vanilla. I just installed your extension it has some problems when you try to delete item and it shows error almost everywhere.
  • All I can say is that it worked on a fresh install for me, so you might have to do a little further digging to find out what the problem is.

    Nicole1978: Could you post the remaining part of the error message. It looks like there is a database error while creating the tables. Can you dig out that database error?

    Feruz: do you have any examples of the errors you see?
  • Looks like I haven't implemented settings postback UserFieldDefRemove, so you cannot delete fields through the interface yet.

    For now disable it or set its permissions to 'none' for all roles.
  • Hello...

    This is the Error-Message ...

    A fatal, non-recoverable error has occurred
    Technical information (for support personel):

    Error Message
    An error occurred while attempting to retrieve the requested user field definitions.
    Affected Elements

    The error occurred on or near: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''READ' then 1when 'WRITE' then 2when 'ADMIN' then 3 else 0 end as PermCodeLevel ' at line 1

    For additional support documentation, visit the Lussumo Documentation website at:

    LG Nicole
  • That looks like it could be the MySQL version. It needs to support CASE constructs. I am using MySQL 5.0. I expect 4.0 will work, but 3.x may have problems. Could that be the problem?

    -- Jason
  • My MySql version is 5.0.45...

    LG Nicole
  • i am experiencing the same problem as LG
  • This bit:
    syntax to use near ''READ' then 1when 'WRITE' then 2when 'ADMIN' then 3 else 0 end as PermCodeLevel '
    There are no spaces after the numbers. Is that how the error message displays, or is it an artefact of the copying and pasting?

    Can you also confirm that all three tables were created:


    There is a MySQL dump in the docs folder to compare against your schema.

    I'm using both MySQL versions 4.1.22 and 5.0.58

    -- Jason
  • Uploaded version 0.2.1 of UserFields.
  • Hi I`ve just installed version 0.2.1 on a fresh vanilla 1.1.5a installation
    When I click on "View user fields" all I get is the following message:

    Warning: Invalid argument supplied for foreach() in C:\xampplite\htdocs\vanilla\extensions\UserFields\account.php on line 160

    Unfortunately I have no idea what could be wrong here?
    Thanks in advance for your help
  • babs108: I'll put a check in to avoid that error message. In the meantime, you will need to create at least one user field, visible to everyone, through the settings section.

    -- Jason

    Edit: The fix is done, and will be included in the next version.
  • That's how the error appears no spaces in the numbers. Also I'm not sure what you mean by tables (sorry!) If you're talking about the paths in the FTP files it UserFields, paths include ajax docs and install. Is that wrong? Thanks for your help and patience!
  • The lack of spaces in that error message really stump me, as do the lower-case reserved words. When I force an error in that part of the code on my instance, it looks like this:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''READ' THEN 1 WHEN 'WRITE' THEN 2 WHEN 'ADMIN' THEN 3 ELSE 0 END AS PermCodeLev' at line 1

    I've been through the older versions of Vanilla and cannot see any fixed bugs in that area. I don't know if anyone else here is having this problem, but I would love to know.

    The only possibility I can think of, is that the install of one of the tables did not work on your version of MySQL (which I would need to fix).

    -- Jason
  • This would be a great extension for collecting our club membership data and expiration date for our club secretary. Any idea why I am getting a Undefined property: UserFieldDef::$UserFieldID in the file UserFieldType.base.php on line 113? I have two text fields defined. One is membership number and the second is expiration date. Using latest version of Vanilla and of this plugin with default theme.


  • Dan: This is exactly the reason I created this extension. An organisation wishes to store profile information concerning individuals using the forum (it is a closed user group). Some of the information can be updated by the individuals, and some can not. e.g. full name and region cannot be changed by the individuals, but can be seen by other users. Similarly, some information (like your expiry date) can be set by an administrator, seen only by the individual, but not seen by anyone else. For this client, I have set up a couple of database views that return flattened information from this module, and they are used to display user information formatted in templates in a connected CMS. First time I've tried views in MySQL5, and they are great.

    On to your error, it looks like a simple typo. I'll prepare a new release soon, but if you change like 113 from this:

    if (!empty($this->UserField)) $this->UserFieldID = $UserFieldDef->UserFieldID;

    to this:

    if (!empty($this->UserField)) $this->UserFieldID = $UserField->UserFieldID;

    does the error go away?

    -- Jason
  • Uploaded version 0.2.2 of UserFields.
  • The release 0.2.2 should contain the fixes I'm mentioned in this thread (and, no doubt, a bunch more bugs to be reported). Have fun, and don't forget to include as much information as you can to help me pinpoint the source of any bugs.
  • Ok judgej,

    The update fixed the error problem I was having above and now the info I had already defined displays properly but when I try to edit the information I am getting an "Undefined variable:" error and "Trying to get property of non-object error" both in line 262 of account.php. So it appears there is a problem there but I am so new to all this I can't see what is wrong with that line.

    Glad to see that I am going to be using this for the same purpose that you originally intended. Looks like a great addition for our membership information.

  • If this is the line:

    . GetUrl($Context->Configuration, 'account.php', '', '', '', '',

    Try changing it to:

    . GetUrl($this->Context->Configuration, 'account.php', '', '', '', '',

    If that works, I'll make the fix this end.

    I suspect I have some server settings that are suppressing the errors other people are seeing. I'll try to fix that before the next release.
  • Oh Yeah!

    That fixed it! I have placed it in use and will start collecting data from users. Will let you know if I find anything else but right now it is working with the information I plan to collect.


  • Just started playing around with PageManager. Is the support for a tab for UserFields something that you have to build in or is it just something I haven't figure out how to add to PageManager yet?

  • That's a good question. If there is anything special I need to add to get PageManager support, then I'll add it (let me know if you find anything).

    Another module I would like to provide support for is Mulitroles (something - along with hierarchical comments) that I believe should be built into the core, because proper support for it has implications in other modules. Binding a module to the core is one thing, but I'm always uncomfortable binding one module to another through functionality that may change.

    -- Jason
  • I installed Memberslist in PageManager and it installed the following in the tab url field of PageManager-- ""-- so it appears that something must be supported by the author of the plugin because I didn't add it manually.

    Would be nice to have the UserFields available on a Page Manager tab but I am not certain how much work that would be. I am new to all this so I maybe missing something but that is all I have found thus far. PageManager has its own options to display or hide the tab depending on role so this would be a duplication of how you handle access to your UserField data. This may be too much of a rewrite than it is worth. Again, I am new to all this. I am using it as is now and so far it is working fine.

  • A long time ago, I made an extension called IDShare. This was back when the Nintendo DS was relatively new. All the users on my forum were creating separate threads for each and every game that came out in order to share friend codes. They were also creating threads to share usernames for Facebook,MySpace,XBox,etc.

    The idea of IDShare was that users would be able to set all these things in their profiles, and then there would be an extra tab in the forum that would allow people to, for example, see the Digg usernames of everyone in the forum on one page. I have it still running on my forum, even though I have not updated it in a very long time. I have never officially released it because while it is stable and fast, it is not user friendly at all. The only way to add more fields is to modify the configuration in the extension's default.php. Also, users have to "just know" to set their information in their profiles to the correct tags.

    Looking at your extension, I think the solution is a combination. I have gotten inspired to start working right away. I think UserFields can provide the user friendliness that IDShare was lacking.

    There is just one thing that I think we need, and that is some way to group fields into categories. If there are too many fields, the interface can be very cluttered. By grouping fields together into groups, e.g: social networks, video games, etc. it can be really clean and slick.
  • Apreche,

    I am using the group setting in the UserField Manage User Fields and then grouping the different fields under that group. The format I think is "GroupName | Info name. Like "Personal Information | Birthday" and then just keep adding different fields like "Personal Information | Location", etc. This groups them all under the tab "Personal Inforamtion".

  • Grouping fields into categories is already built in :-)

    Just put the category in front of the field name, separating it using a bar '|'. The category then becomes a CSS tab in the screen that shows the field values. You can have as many such categories or tabs as you like. In theory they could be nested, e.g. Games|Platform|My Cheat Codes, but that is still a TODO.

    -- Jason
Sign In or Register to comment.