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

[5.x]: editableTable error "Uncaught No disclosure container found." #15543

Closed
svondervoort opened this issue Aug 16, 2024 · 3 comments
Closed
Labels

Comments

@svondervoort
Copy link

What happened?

Description

We have a custom (private) plugin where we use the editableTable form include in the settings, but after upgrading a project to Craft 5 it isn't working properly anymore.

Whenever I press the Add button in console it will show the error Uncaught No disclosure container found.. But when Inspect the HTML I do see a <tr> has been added. If I remove the hidden class from the table it will show up and it is working almost like it should. When I have two rows and delete the last one it removes both rows.

I've tried looking for documentation but I can only find the include. The Craft 5 upgrade guide doesn't give me much to go on either.

Steps to reproduce

Not sure if this is even possible without having the plugin installed.

The code of the _settings.twig page.

{% import "_includes/forms" as forms %}

{% set options = {} %}
{% for section in craft.app.entries.allSections() %}
    {% for entryType in craft.app.entries.getEntryTypesBySectionId(section.id) %}
        {% set name = section.name %}

        {% if section.name != entryType.name %}
            {% set name = name ~ ' (' ~ entryType.name ~ ')' %}
        {% endif %}

        {% set options = options|merge([{ label: name, value: entryType.id }]) %}
    {% endfor %}
{% endfor %}

{{ forms.editableTableField({
    label: 'Query string params that should be cached as unique pages',
    name: 'sectionQueryStringParams',
    cols: {
        section: {
            type: 'select',
            heading: 'Section',
            options: options
        },
        queryStringParams: {
            type: 'singleline',
            heading: 'Query string params',
            info: 'Each query string param should be comma separated. E.g. query,sort',
            code: true,
        },
    },
    rows: settings.sectionQueryStringParams,
    allowAdd: true,
    allowDelete: true
}) }}

Expected behavior

Removing the hidden class after adding a row and only removing the row where the remove button is clicked.

Actual behavior

Table stays hidden and deletion of rows is removing more then needed.

Craft CMS version

5.3.2

PHP version

8.3

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

  • "putyourlightson/craft-blitz": "^5.6"
@brandonkelly
Copy link
Member

Thanks for reporting that! The code wasn’t accounting for tables with allowAdd: true but not allowReorder: true. Fixed for the next release.

@brandonkelly
Copy link
Member

Craft 5.3.5 is out with that fix. Thanks again for reporting!

@svondervoort
Copy link
Author

Can confirm it works now, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants