akeeba / fof

Rapid Application Development framework for Joomla!™ 3 and 4
0 stars 0 forks source link

Problem with relations #605

Closed Eighke closed 7 years ago

Eighke commented 8 years ago

Hi Nic,

I have found a strange bug (behaviour ?) using the belongTo (maybe all relation types?). I will try tomorrow on a fresh installation of Joomla but I doubt it come from there (I have just JCE installed).

The configuration:

<model name="Tests">
    <relation name="foo" type="belongsTo" />
    <relation name="bar" type="belongsTo" />
</model>
<?xml version="1.0" encoding="utf-8"?>
<form
    type="browse"
>
    <fieldset name="items">
        <field name="foo.title" type="Text"/>
        <field name="bar.title" type="Text"/>
    </fieldset>
</form>

<field name="foo.title" type="Text"/> will work and display the title but <field name="bar.title" type="Text"/> will not. But if I reorder the relations in fof.xml:

<model name="Tests">
    <relation name="bar" type="belongsTo" />
    <relation name="foo" type="belongsTo" />
</model>

This time only <field name="bar.title" type="Text"/> will be displayed.

So I think only the first relation is activated.


I tried to create the in fof.xml for the relations, but it doesn't change.

But I noticed that if I create the relation models (Model/Bar.php and Model/Foo.php) it will work after that (but well the goal is to use MagicFactory :))