Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wagon serve + belongs_to "chain" results in "Action error - undefined method `is_relationship?' for nil:NilClass" #398

Open
greyskin opened this issue May 27, 2021 · 0 comments

Comments

@greyskin
Copy link

greyskin commented May 27, 2021

I have the following content_types setup:

  • content_type1:
    • field1: belongs_to content_type2
    • other standard fields
  • content_type2:
    • field 1: belongs_to content_type3
    • other standard fields
  • content_type3:
    • all standard fields

(Note the "chained" belongs_to relationship. content_type1 belongs to content_type2 which belongs to content_type3.)

I have the following {% action %}

{% action "test" %}

    var entries = allEntries(
        'content_type2', {
            name: 'Test1'
        }
    );

    setProp('entries', entries);

{% endaction %}

{{ entries }}

When I deploy to station.locomotive.works this all works fine - it returns a print out of the Test1 content entry, like so:

{"_id"=>"xxx", "_slug"=>"test1", "_visible"=>true, "_position"=>0.0, "content_type_slug"=>"content_type2", "created_at"=>"xxx", "updated_at"=>"xxx", "_label"=>"Test1", "name"=>"Test1", "system_url"=>"", "content_type3_id"=>"xxx", "seo_title"=>"", "meta_description"=>"", "meta_keywords"=>""}

However, when I run wagon serve, I get the following error message:

Action error - undefined method `is_relationship?' for nil:NilClass

I can get print outs for content_type1 and content_type3 without any issue when running wagon serve. Only content_type2 (with the "chained" belongs_to relationship) causes an error.

@greyskin greyskin changed the title wagon serve + belongs_to "chain" = undefined method `is_relationship?' for nil:NilClass wagon serve + belongs_to "chain" results in "Action error - undefined method `is_relationship?' for nil:NilClass" May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant