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

Revert "Updated regex for ID" file input widget problem #302

Open
simplyr opened this issue Feb 13, 2020 · 0 comments
Open

Revert "Updated regex for ID" file input widget problem #302

simplyr opened this issue Feb 13, 2020 · 0 comments

Comments

@simplyr
Copy link

simplyr commented Feb 13, 2020

The latest commit 75c4271 not working with widget-fileinput by kartik. You can see that in your example here dynamicform-demo2

When you pick an image and then try to duplicate you get this error:
yii2-dynamic-form.min.js:8 Uncaught TypeError: Cannot read property 'widgetItem' of undefined
at _updateAttrID (yii2-dynamic-form.min.js:8)
at HTMLDivElement. (yii2-dynamic-form.min.js:8)
at Function.each (jquery.js:374)
at jQuery.fn.init.each (jquery.js:139)
at HTMLTableRowElement. (yii2-dynamic-form.min.js:8)
at Function.each (jquery.js:374)
at jQuery.fn.init.each (jquery.js:139)
at _updateAttributes (yii2-dynamic-form.min.js:8)
at _addItem (yii2-dynamic-form.min.js:8)
at jQuery.fn.init.addItem (yii2-dynamic-form.min.js:8)

When I replace:
var regexID = /^(.+?)([-\d-]{1,})(.+)$/i;
with the old one
var regexID = /^(.+?)(-\d{1,}-)(.+)$/i;
everything works just fine.

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