I think your plugin maybe can fix this bug, but it is used in controller, how to use in model?
public $belongsTo = [
'priority' => ['Leadrive\Pm\Models\ConfigStatus',
'conditions' => 'field_name = "wx_issue_priority"'
//'scope' => 'isWxIssuePriority'
in the columns.yaml
In the model, if the relation has conditions or scope, it will not work, such in the list, it will not working, because the 'priority' return more records. The table leadrive_pm_config_statuses maybe is:
id field_name name
1 wx_issue_priority priority class 1
1 issue_priority priority class 1
Because the conditions did not work, so it will return 2 records(the correct answer is one record),
The url that you have post is you have been changed one core file of cms. In that case that is not good idea.
In plugin extender, I extend the realtion controller fixed the bug in their,
all you need to do is do the normal thing that you are doing in model.
About your problem in 2 records is returned make sure condition that you are creating will return 1.
Or add limit
Thanks your reply.
For the RelationBehavior
Step 1: Instead of using "Backend.Behaviors.RelationController" to implement in Controller, use "Cyd293\Extenders\Behaviors\RelationController"
Step 2: add this "\Cyd293\Extenders\Traits\RelationTrait" trait in your controller
My controller did not have RelationController implement, it only have public $belongsTo in the model. And the $belongsTo has a conditions, but the OctoberCMS has a bug, so the conditions did not working.
We are proud to announce that the stable release of the October CMS 2 is now available! The release represents over a year of design, research and development effort, which resulted in multiple new features and changes.