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

Variable contentTypesToShow in LeftMenuLinkContainer is always undefined #2353

Closed
henrych4 opened this issue Nov 21, 2018 · 1 comment · Fixed by #2354
Closed

Variable contentTypesToShow in LeftMenuLinkContainer is always undefined #2353

henrych4 opened this issue Nov 21, 2018 · 1 comment · Fixed by #2354
Assignees
Labels
issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around status: confirmed Confirmed by a Strapi Team member or multiple community members

Comments

@henrych4
Copy link
Contributor

Informations

  • Node.js version: 10.10.0
  • npm version: 6.4.1
  • Strapi version: 3.0.0-alpha.14.5
  • Database: mongodb
  • Operating system: mac OS

What is the current behavior?
The variable contentTypesToShow is always undefined.

const contentTypesToShow = get(layout, 'layout.contentTypesToShow');

Steps to reproduce the problem
Create a project, add log to print the value

What is the expected behavior?
It should give contentTypes as shown in /admin/layout

Suggested solutions
After reading the source codes, it probably relates to the following line:

const [{ uuid }, { strapiVersion }, { currentEnvironment }, { layout }] = yield all([

Previously, layout is assigned by:

const layout = yield call(request, '/admin/layout', { method: 'GET' });

And it looks like this: { layout: { contentTypesToShow: {...} } } and hence get(layout, 'layout.contentTypesToShow'); retrieves correct value.

Since shorthand property is used, "layout" is no longer needed in path.

@lauriejim lauriejim added issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around labels Nov 23, 2018
@soupette
Copy link
Contributor

@henrych4 thanks for reporting it I've noticed it and I think I will simply remove this from the admin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around status: confirmed Confirmed by a Strapi Team member or multiple community members
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants