angus
(Angus McLeod)
12.Июль.2019 10:46:06
4
Да, она возникала несколько раз в прошлом. Эта последняя волна, похоже, совпадает с недавней работой над компонентом has_custom_fields.rb, поэтому, возможно, там есть что проверить.
Это не исправляет проблему, но помогает справиться с ней, если она возникнет:
master ← angusmcleod:add_limit_to_custom_field_ordering
closed 01:38PM - 12 Jul 19 UTC
While not likely, it is possible to end up with two rows in a custom field table… with the same related id.
See further: https://meta.discourse.org/t/custom-field-casting-affected-by-recent-update/122746
For example: https://discourse.angusmcleod.com.au/t/events-code-error-500/1254/4
The data will look something like this.
``topic_custom_fields``
| id | topic_id | name | value |
| ------------- | ------------- | ------------- | ------------- |
| 9180 | 62 | event_start | 1563100201 |
| 9179 | 62 | event_start | 1563100201 |
In most respects this eventuality can be handled in a plugin, however there is one place where this causes a cardinality issue that can't be handled in a plugin: ordering by the custom field in a ``TopicQuery``.
This PR adds a LIMIT to the custom field ordering statement in ``TopicQuery`` to handle that eventuality.