Welcome, Guest
Username: Password: Remember me

TOPIC: no effect by QuestionAttribute::model()->setQuestionAttribute(...)

no effect by QuestionAttribute::model()->​;setQuestionAttribute(...) 6 months 4 days ago #106667

  • orvil
  • orvil's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 104
  • Thank you received: 4
  • Karma: 4
Hi,

need some help, please: currently I've tried to set some question attributes by using the API function "setQuestionAttribute", e.g.:
QuestionAttribute::model()->setQuestionAttribute($qid, 'hidden', 1)

where $qid is the question ID. Nevertheless, it takes no effekt, Attribute is not stored anyway. API function is called (tested this). Is there any call to do in front or afterwards? Could not find this in the documentation.

THX
Best regards/Beste Grüße,
O. Villani
The administrator has disabled public write access.

no effect by QuestionAttribute::model()->​;setQuestionAttribute(...) 6 months 4 days ago #106669

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6358
  • Thank you received: 824
  • Karma: 245
Looking at code, seems setQuestionAttribute is bugy.

Update existing attribute, but not add attribute.
Working system seems to be in database.php line 526 and more, but we need the language too, we can find with survey language.

Maybe you can put this to bug report.
Last Edit: 6 months 4 days ago by DenisChenu.
The administrator has disabled public write access.

no effect by QuestionAttribute::model()->​;setQuestionAttribute(...) 6 months 4 days ago #106682

  • orvil
  • orvil's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 104
  • Thank you received: 4
  • Karma: 4
Yes, you are right, tried this. Once an attribute is set, it can be altered by setQuestionAttribute().
Will do a bug report.
Best regards/Beste Grüße,
O. Villani
The administrator has disabled public write access.

no effect by QuestionAttribute::model()->​;setQuestionAttribute(...) 6 months 3 days ago #106731

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6358
  • Thank you received: 824
  • Karma: 245
I'm not sure we use setQuestionAttribute anymore. Maybe it's best to rewrite it and use it in database.php
The administrator has disabled public write access.

no effect by QuestionAttribute::model()->​;setQuestionAttribute(...) 6 months 1 day ago #106842

  • orvil
  • orvil's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 104
  • Thank you received: 4
  • Karma: 4
well, may be it will be so. Bult a working version of thie setQuestionAttribute procedure meanwhile.
anyway the main database.php function index seems to me as an neverending codemonster, crying for a dispatcher function to split up the different "actions" in private functions.
This is why I dont dare to touch this function, to me it is a little too compicated.
Best regards/Beste Grüße,
O. Villani
The administrator has disabled public write access.

no effect by QuestionAttribute::model()->​;setQuestionAttribute(...) 6 months 1 day ago #106860

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6358
  • Thank you received: 824
  • Karma: 245
Oh yes, sorry

You're totally rigth , i move the bug to devloppement and assign it to me.

I think too we must remove database.php and move whole system in each model, but dev issue.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.147 seconds
Donation Image