#63 ✓hold
gwhn

Problem adding publication entry list to page for custom content model with has many relationship

Reported by gwhn | July 5th, 2010 @ 07:36 AM

I am trying to create a custom content model hierarchy to represent a company that has many projects. Each project should also have many responsibilities. I created a Company model that has a has many relationship to a Project model. I have specified that the Project model belongs to a Company model and has a has many relationship to a Responsibility model. Similarly, I have created a Responsibility model that belongs to a Project model. I created a publication entry list for the Company model, but when I add the publication to a page I get a server error. The Apache log contains the following:

[Mon Jul 05 11:15:50 2010] [error] [client 90.198.103.226] Premature end of script headers: website, referer: http://www.weblitz.me.uk/website/edit/page/page/18/en [ pid=11841 file=ext/apache2/Hooks.cpp:706 time=2010-07-05 11:15:50.29 ]: The backend application (process 11903) did not send a valid HTTP response; instead, it sent nothing at all. It is possible that it has crashed; please check whether there are crashing bugs in this application.

I've upgraded passenger to 2.2.15 but get the same error.

When I remove the has many relationship to the Project model from the Company model, recreate the entry list publication for the Company model, and add the publication to a page, it does not give the error, so it appears there is either a problem with my method, or a bug.

Any ideas would be greatly appreciated.

Comments and changes to this ticket

  • Pascal Rettig

    Pascal Rettig July 6th, 2010 @ 04:54 PM

    • State changed from “new” to “open”

    We haven't tested nesting content models that deeply, there may be a circular dependency issue - will get back to you on this.

  • Pascal Rettig

    Pascal Rettig August 11th, 2010 @ 08:03 PM

    • State changed from “open” to “hold”

    The belongs_to and has_many relationships aren't standard Rails relationships in that they are actually a relationship related to an individual field - i.e. you can have multiple has_many relationships in a single model to the same related model on two different fields, without having a corresponding belongs_to relationship in the other model - i.e. the has_many is not the inverse of belongs to, so I believe what happened is that you ended up with a circular dependency.

    We will be adding a "natural" has many to support this sort of use case where the has many field is actually related to a belongs_to field in another model.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket

Pages