Uncaught TypeError: Cannot read properties of undefined (reading 'replace')

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
kdim95
Advanced
Posts: 213
Joined: 26 Aug 2022, 12:17

Uncaught TypeError: Cannot read properties of undefined (reading 'replace')

Post by kdim95 » 26 Jun 2023, 11:49

Laravel framework version: 10.13.5
Aimeos Laravel version: ~2023.04
PHP Version: 8.2.7
Environment: Linux

The error occurs when I go to a product details page:
/admin/default/jqadm/get/product/<product id>

Error: Uncaught TypeError: Cannot read properties of undefined (reading 'replace')

The error occurs on line 162 here: vendor/aimeos/ai-admin-jqadm/js/product.js

Code: Select all

for(entry of $('.item-product .item-characteristic-attribute .attribute-list')) {
			const name = $(entry).attr('id');
			components.push({
				name: name.replace(/-/, '/'),
				el: '#' + name,
				data: {
					items: $(entry).data("items"),
					keys: $(entry).data("keys"),
					prefix: $(entry).data("prefix"),
					siteid: $(entry).data("siteid"),
					listtype: $(entry).data("listtype")
				},
				mixins: [Aimeos.Product.Attribute.mixins.bind(this)()]
			})
		}
"name" is undefined.

Code: Select all

name: name.replace(/-/, '/')

kdim95
Advanced
Posts: 213
Joined: 26 Aug 2022, 12:17

Re: Uncaught TypeError: Cannot read properties of undefined (reading 'replace')

Post by kdim95 » 26 Jun 2023, 13:23

The error seems to have been fixed now.
aimeos-admin-jqadm has been updated to 2023.04.8

User avatar
aimeos
Administrator
Posts: 8616
Joined: 01 Jan 1970, 00:00

Re: Uncaught TypeError: Cannot read properties of undefined (reading 'replace')

Post by aimeos » 26 Jun 2023, 13:49

Introduced because you've copied the file from dev-master to you setup.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply