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

Undefined index: handle when used in a Matrix field #1

Closed
louderthan10 opened this issue May 6, 2015 · 10 comments
Closed

Undefined index: handle when used in a Matrix field #1

louderthan10 opened this issue May 6, 2015 · 10 comments

Comments

@louderthan10
Copy link

Hi guys,

I'm running into an issue where some entries are getting an error when they contain a Matrix block with your field in it. Specifically in this case, the same Matrix block has a standard table, which is populated with data, and has a supertable which is not populated (not sure if that's relevant).

screen shot 2015-05-05 at 16 54 24

If I remove the supertable field from the Matrix, the entry works again.

@engram-design
Copy link
Member

Hmm - seems interesting that the error is being thrown by TableFieldType.php, and not SuperTableFieldType.php.

Anyway, I've attached a few screenshots of what I've got going, and have tested working. Can you confirm, or let me know if its not correct?

Alternatively - just post some screenshots of your Matrix layout :)

screen shot 2015-05-06 at 10 18 54 am

screen shot 2015-05-06 at 10 19 02 am

screen shot 2015-05-06 at 10 19 22 am

@engram-design
Copy link
Member

@louderthan10 any further developments with the above?

@KnutSv
Copy link

KnutSv commented Jul 6, 2015

For me plain text fields inside super table inside matrix seems to work fine, but once i try to use dropdown-fields or category-fields I can't retrive the data without getting error messages. For example for a dropdown field i get the value "1" for all selections when i use {{ block.field }}. If I try to retrive {{ block.field.value }} or {{ block.field.label }} I get error messages like this:

Craft\SuperTable_BlockTypeModel and its behaviors do not have a method or closure named "value".

@engram-design
Copy link
Member

@KnutSv Sorry for the delay in getting back to you about this. I've been struggling to reproduce your error. See the below screenshots and code which works for me.

screencapture-client-craft-dev-office-settings-fields-edit-65-1437182656118
screen shot 2015-07-18 at 11 24 27 am
screencapture-client-craft-dev-office-entries-homepage-2-homepage-1437182901347

{% for block in entry.matrixSuperTable %}
    {% for row in block.superTable %}
        {{ row.dropdown.label }}: {{ row.dropdown.value }}<br />
    {% endfor %}
{% endfor %}

Results in:

Option 1: Option 1
Option 2: Option 2
Option 2: Option 2
Option 1: Option 1

@KnutSv
Copy link

KnutSv commented Jul 27, 2015

Thanks, it turned out my issue was caused by using "type" as a handle. Changing the handle fixed the issue.

@rickprince
Copy link

I'm getting this error too. Currently I'm getting it on SuperTableFieldType.php(78), but I've also seen the error for other blocks even though its when I'm adding a Super Table.

I have a bunch of different blocks within a widget matrix block:
image

Which produces:
image

I'm using a fairly specific handle, so it can't be that. Any thoughts? Happy to share access to my repo and db if it helps in reproducing the error. Thanks Josh!

@engram-design
Copy link
Member

@rickprince Interesting, I'd be interested to see your specific field setup. Probably best to get it touch via Slack, or send through an export of the field using Field Manager

@engram-design
Copy link
Member

Closing for now - please reopen or create a new issue if you're still experiencing this.

@shealan
Copy link

shealan commented Feb 22, 2016

I'm running into this same issue. Latest Craft and Supertable. Line 79.

@engram-design
Copy link
Member

There are known issues with a Super Table / Matrix configuration and field handle validations. A Super Table field on its own will validate properly. This issue is usually due to a field using a reserved handle. @shealan are you able to confirm this? Happy to debug further in Slack?

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

5 participants