Skip to content

Fix to bug in atk/src/Relations/ManyToOneTreeRelation.php #56

@jgarifuna

Description

@jgarifuna
    # in edit() method:
        # to avoid ambiguity error
        change:
            $recordset = $this->m_destInstance->select($this->m_destInstance->m_primaryKey[0])->includes($tmp2)->getAllRows(); // original

        to:
            $recordset = $this->m_destInstance->select($this->m_destInstance->getTable() . '.' . $this->m_destInstance->m_primaryKey[0])->includes($tmp2)->getAllRows(); // by Jorge Garifuna

        # to have the correct selected value in the drop down list
        change:             
            $this->m_current = $this->m_ownerInstance->primaryKey($record); // original

        to:
            $this->m_current = $this->m_ownerInstance->primaryKey($record[$this->fieldName()]); // by Jorge Garifuna

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions