Moin
12 ديسمبر 2025، 9:57ص
1
أعلم أن هناك إعدادًا في تفضيلات الواجهة الخاصة بي، ولكن بطريقة ما لا يعمل بالنسبة لي:
يقول “تم حفظ التغييرات” ولكن القيمة في قاعدة البيانات لا تزال “صحيح” (
true)، لذلك بعد إعادة التحميل تظهر مرة أخرى كـمُمكَّنة.
إعجاب واحد (1)
pfaffman
(Jay Pfaffman)
12 ديسمبر 2025، 11:53ص
3
غريب. هل حاولت رؤيته في إطار عمل ريلز (rails)؟
Moin
12 ديسمبر 2025، 11:59ص
4
كيف أفعل ذلك؟ ميتا ليس منتدى لي
إعجاب واحد (1)
أشعر بالتردد في استخدام modifyClass ولكني لم أتمكن من التوصل إلى طريقة أفضل (إشعار @david / @cvx )
main ← fix-save-ai-search-discovery-user-preference
opened 01:09PM - 12 Dec 25 UTC
The "Enable AI search discoveries" checkbox in user preferences wasn't persistin… g changes. The UI showed "saved" but the value never reached the database.
The Interface controller's `saveAttrNames` is a computed property that returns a new array on each access. While the plugin called `addSaveableUserOptionField()`, this only registers the field with the User model. The controller filters which fields to save via `saveAttrNames`, and since `ai_search_discoveries` wasn't in that list, it was excluded from the save request.
Fix by using `modifyClass` to extend the controller's `save()` action, pushing `ai_search_discoveries` to `saveAttrNames` at the moment of saving before calling the parent method.
Ref - meta/t/391135
إعجاب واحد (1)
david
(David Taylor)
12 ديسمبر 2025، 1:10م
6
في الواقع، modifyClass ليس مثاليًا، خاصة في المكون الإضافي الأساسي (core plugin).
سيكون الأفضل هو تقديم valueTransformer جديد في النواة (core)، حتى يكون لدينا طريقة “مدعومة” للقيام بهذا النوع من الأشياء.
3 إعجابات
Moin
12 ديسمبر 2025، 11:48م
8
شكرًا لك. لقد تم تعطيله أخيرًا