Open leonixyz opened 6 months ago
@leonixyz One issue in the View class is that either you need to name the gridfield Buttons
or call setCustomRelationName
on GridFieldSortableRows
to tell it what the name of the relationship is so it can find the correct relationship. In the View class the GridField's name is AttachmentsCategories
for the buttons relationship. It looks like this is the case for all of the buttons at least. Double check your GridField names (or call that setCustomRelationName
) and let me know if that fixes your issue 😄.
Affected Version
Description
A wrong query is issued to the database, having empty table name and empty column names.
If, after hitting the error, you examine the database, you'll find the many-to-many table has the new record correctly appended, but the
SortOrder
column is set at 0. Manually changing it to 1 solves the problem. But anytime you need to create a new one, the problem is back.https://github.com/UndefinedOffset/SortableGridField/assets/4563795/5e79c425-d62d-4536-a301-8e7ef5fc0c92
Stack trace:
Steps to Reproduce
Given the following relations, whenever you try to create a new
Button
, disregarding whether you do it from theView
gridfield, or from theMetricGroup
gridfield, you get a 500 and the above error.Please forgive me if the code is redundant.
GridFieldConfig.php
Attachments.php
MetricGroup.php
View.php