You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Craft.EntryIndex class doesn't properly update the available publishableSections in the $newEntryBtnGroup. Currently this code is executed to display all available Sections inside the New entry button, thus users can select all of their sections when they want to create a new entry - no matter if the section is even available in the current site or not. Here is the code
publishableSections contains all sections, so it doesn't care if they are enabled or not
publishableSections: [
{% if isInstalled and currentUser is defined and currentUser %}
{% for section in craft.app.sections.getEditableSections() %}
{% if section.type != 'single' and currentUser.can('createEntries:'~section.id) %}
{
id: {{ section.id }},
name: "{{ section.name|t('site')|e('js') }}",
handle: "{{ section.handle|e('js') }}",
type: "{{ section.type }}",
entryTypes: [
{% for entryType in section.getEntryTypes() %}
{
id: {{ entryType.id }},
name: "{{ entryType.name|t('site')|e('js') }}",
handle: "{{ entryType.handle|e('js') }}"
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}{% if not loop.last %},{% endif %}
{% endif %}
{% endfor %}
{% endif %}
],
It just checks if the user can edit the section or not.
Steps to reproduce
Create multiple sites and multiple different sections
Disable some of those sections for certain sites
Click on the "New Entry" button and see all those sections as available sources no matter if they are enabled for the current selected site or not
Steps to fix this
include the ids of all available sites in the publishableSections object
include an additional condition if (this.settings.context === 'index' || section !== selectedSection) { if the current selected siteId this.siteId is in the array of site ids.
Description
The
Craft.EntryIndex
class doesn't properly update the availablepublishableSections
in the$newEntryBtnGroup
. Currently this code is executed to display all availableSections
inside theNew entry
button, thus users can select all of their sections when they want to create a new entry - no matter if the section is even available in the current site or not. Here is the codepublishableSections
contains all sections, so it doesn't care if they are enabled or notIt just checks if the user can edit the section or not.
Steps to reproduce
Steps to fix this
publishableSections
objectif (this.settings.context === 'index' || section !== selectedSection) {
if the current selected siteIdthis.siteId
is in the array of site ids.and
The text was updated successfully, but these errors were encountered: