Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.


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 mandatory=0 multiselect=0 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 UserFieldsManager.GetUserFieldDefData(); 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.
Sign In or Register to comment.