Cannot read properties of undefined (reading ‘replace’)
-
Hi, when editing a fieldgroup in the ACF section (https://mysite.tld/wp-admin/edit.php?post_type=acf-field-group) I get the following error:
jquery.min.js?ver=3.6.4:2 Uncaught TypeError: Cannot read properties of undefined (reading 'replace') at HTMLDivElement.<anonymous> (input.js?ver=6.2.2:32:29) at Function.each (jquery.min.js?ver=3.6.4:2:3003) at e.<computed>.each (jquery.min.js?ver=3.6.4:2:1481) at input.js?ver=6.2.2:28:43 at acf-input.min.js?ver=6.1.6:1:2258 at o (acf.min.js?ver=6.1.6:1:1417) at Object.doAction (acf.min.js?ver=6.1.6:1:587) at n.doAction (acf.min.js?ver=6.1.6:1:19465) at HTMLDocument.<anonymous> (acf.min.js?ver=6.1.6:1:28734) at e (jquery.min.js?ver=3.6.4:2:30158)
The issue seems to be that
acf.get_fields({ type : 'column'}, $el)
inacf-column/js/input.js
on line 28 returns some elements butcolumns
inside the loop below (line 30) becomes undefined. Due to that theorig_key.replace("_", "-")
(line 32) fails becauseorig_key
is undefined too. I don’t know if this is an issue with ACF itself or with the columns plugin but adding the following condition before line 30 solves the issue.if(!$(postbox).find('.acf-column').length) { return; }
Could that be possible?
Using:
WordPress 6.6.2
ACF Pro 6.1.6
ACF Column 1.2.5
- The topic ‘Cannot read properties of undefined (reading ‘replace’)’ is closed to new replies.