Welcome, Guest
Username: Password: Remember me

TOPIC: attribute fields in LS 1.90+

attribute fields in LS 1.90+ 3 years 9 months ago #54050

  • boykov
  • boykov's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 10
  • Karma: 0
Hi.

I have been running LS 1.80+ for a long time. I use non-anonymous surveys and my system is heavily dependent on storing id-values in attribute_1 and attribute_2 fields.

I upgraded to 1.90+(9596) successfully. However, when I create a new survey and activate it in 1.90, the token table doesn't have attribute_1&2. Why?

I need to find a workaround asap. I added the missing fields manually, is this going to do the job? In which php-file is the method for creating the token-table? I also need to fix the spss-export to include those two fields (attribute_1&2).

Thanks in advance.
The administrator has disabled public write access.

Re:attribute fields in LS 1.90+ 3 years 9 months ago #54051

  • mdekker
  • mdekker's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 341
  • Thank you received: 68
  • Karma: 38
You can create as many additional attributes as you like in the new version. There is an icon for it in the token screen.
---
Menno Dekker
The administrator has disabled public write access.

Re:attribute fields in LS 1.90+ 3 years 9 months ago #54057

  • boykov
  • boykov's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 10
  • Karma: 0
Thank you.

My problem is that my process is very automated, and I can not go through the token screen every time I activate a survey. My problem was that the fields are not created by default. Now I have solved that with my own php-script which appends the fields to token-table if not exist.

About the spss-export, it seems like all attribute_ fields are detected dynamically and will be exported if they exist in the token-table, right?

Thank you.
The administrator has disabled public write access.

Re:attribute fields in LS 1.90+ 3 years 9 months ago #54063

  • mdekker
  • mdekker's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 341
  • Thank you received: 68
  • Karma: 38
Not really sure about the inner workings of the dynamic token fields, but if you run a test and they export then you are fine. If not, you have to search for another place to tell that the survey has a number of extra attribute fields. A bit too busy to check that for you. If you can report back here it would be helpful for others too.
---
Menno Dekker
The administrator has disabled public write access.

Re:attribute fields in LS 1.90+ 3 years 9 months ago #54159

  • boykov
  • boykov's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 10
  • Karma: 0
Hi.
I have automated the attribute_ field creation in the following way:
$fields = mysql_list_fields($DB, $token_table_name);
$columns = mysql_num_fields($fields);
for ($i = 0; $i < $columns; $i++) {
$field_array[] = mysql_field_name($fields, $i);}
 
if (!in_array("attribute_1", $field_array)) {
	mysql_query("ALTER TABLE " . $token_table_name . " 
ADD attribute_1 varchar(100) default NULL;");
	}
if (!in_array("attribute_2", $field_array)) {
	mysql_query("ALTER TABLE " . $token_table_name . " 
ADD attribute_2 varchar(100) default NULL;");
	}

The SPSS function works just fine. It exports the extra token fields.

Hope this is helpful.
Last Edit: 3 years 9 months ago by boykov.
The administrator has disabled public write access.

Re:attribute fields in LS 1.90+ 3 years 9 months ago #54164

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
Thanks for your feedback.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.162 seconds
Donation Image