We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Model with Inverse relation show error on deletion

Developer Preview

Reinos's avatar
Reinos
79 posts
9 years ago
Reinos's avatar Reinos

I have a model that has an inverse relation with the member model.

class Member extends Model {

    protected static $_primary_key = 'webservice_member_id';
    protected static $_table_name = 'webservice_members';

    protected static $_relationships = array(
        //attach member data
        'Member' => array(
            'type'     => 'belongsTo',
            'model'    => 'ee:Member',
            'from_key' => 'member_id',
            'to_key'   => 'member_id',
            'weak'     => TRUE,
            'inverse' => array(
                'name' => 'Member',
                'type' => 'hasMany',
                'weak'     => TRUE,
            )
        ),
    );

Everthing works great, it get the result for me etc.

But on deleting this model, it shows me this error

Relationship webservice:Member not found in model Member

This error is wrong because i have already an inverse relation, so i have no idea how to fix.

       
Manuel Payano's avatar
Manuel Payano
144 posts
9 years ago
Manuel Payano's avatar Manuel Payano

We also experienced this issue, never got around to figure out where it came from.

       
Reinos's avatar
Reinos
79 posts
9 years ago
Reinos's avatar Reinos

I saw that the Forum module also use this technique, and thats also giving this error when you delete an administrator.

So there is a bug inside the inverse relation.

       
Seth Barber's avatar
Seth Barber
172 posts
9 years ago
Seth Barber's avatar Seth Barber

I can confirm this is a bug. We don’t yet have a solution, but we are working on one.

       
Reinos's avatar
Reinos
79 posts
9 years ago
Reinos's avatar Reinos

Hi Seth,

Is there an update on this issue?

       
Seth Barber's avatar
Seth Barber
172 posts
9 years ago
Seth Barber's avatar Seth Barber

Hi Reinos,

We are still looking into it but do not yet have a patch. It is high on our list of priorities and we hope to have something soon, but we’d rather take our time and get it right than release something that deletes too much. 😊

       
Reinos's avatar
Reinos
79 posts
about 9 years ago
Reinos's avatar Reinos

Hi Seth,

Any progress on this issue, is it fixed in version 3.4?

Let me know.

Best, Rein

       
Reinos's avatar
Reinos
79 posts
7 years ago
Reinos's avatar Reinos

Hi Seth,

Any change you can check this?

Best, Rein

       
Seth Barber's avatar
Seth Barber
172 posts
7 years ago
Seth Barber's avatar Seth Barber

Hi Rein,

This should be resolved in the current version (3.5.10). Are you still experiencing the same error?

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.