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

[BUG] Records variable empty when key and slug are different #164

Open
Mahan-F opened this issue Mar 1, 2018 · 0 comments
Open

[BUG] Records variable empty when key and slug are different #164

Mahan-F opened this issue Mar 1, 2018 · 0 comments

Comments

@Mahan-F
Copy link

Mahan-F commented Mar 1, 2018

I made a contenttype with the key companyAtMedia and the slug company-at-media, I need the contenttype slug to be that because that is the URL for the listing page. And I cannot have hyphens in the contenttype key.

When I go to the listing page, the template loads but the records variable is empty even though I have added a few records, as soon as I remove the translate settings from the contenttype the records load. As the user xiao mentioned on Slack, translate might be looking at the keys instead of the slug of the contenttype.

I cannot not use hyphens for the URL because it is a redesign of a website so the page URLs must stay the same as previous website and I cannot use hyphens in contenttype keys because bolt gives an error saying to change it.

This is my contenttype:

companyAtMedia:
    name: Company at media
    slug: company-at-media
    singular_name: Media post
    singular_slug: media-post
    fields:
        title:
            type: text
            required: true
            group: content
            translatable: true
        slug:
            type: slug
            uses: title
        summary:
            type: html
            label: Post summary
            required: true
            translatable: true
        content:
            type: html
            label: Post body
            required: true
            translatable: true
        image:
            type: image
            label: Post photo
            required: false
            upload: news
            extensions: [ gif, jpg, png ]
        description:
            type: text
            label: Description for search engines
            info: max 160 characters
            group: SEO
            translatable: true
        locale:
            type: locale
        fadata:
            type: hidden
        faslug:
            type: locale_data
            index: true
        endata:
            type: hidden
        enslug:
            type: locale_data
            index: true
        trdata:
            type: hidden
        trslug:
            type: locale_data
            index: true
        aedata:
            type: hidden
        aeslug:
            type: locale_data
            index: true
    default_status: published
    listing_template: pages/company_at_media.twig
    listing_records: 5
    icon_many: "fa:bullhorn"
    icon_one: "fa:bullhorn"

Details

  • Translate Version: 4.1.1
  • Bolt Version: 3.4.8
  • PHP version: 7.0
  • Used webserver: Apache]

Reproduction

You can use the same contenttype settings as I posted above and create a an empty template for listing and just dump(records) to see that it is empty.

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