Hi,
I am trying to add video into my store via admin product edit page. I have already added a youtube api key but when i click on Add Video button than nothing happens.
When i check the error log than its showing
main.CRITICAL: The element 'gallery' already has a child with alias 'content' {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): The element 'gallery' already has a child with alias 'content' at /var/www/vhosts/demo/vendor/magento/framework/Data/Structure.php:611)"} []
Thanks for your answer in advance.
Hi @Sanjay Jethva,
Maybe you're getting a problem with the static assets. Can you try to regenerate the staic content using the console?
php bin/magento setup:static-content:deploy
I assume you're running on production mode.
Hello @Damian Culotta,
Thanks for your reply.
Yes, My website is in production mode and i have put it in developer mode but still the same issue.
Thanks
I am having the same problem. Did you find a solutions. (Same issue in 2.2.5 as well)
No Javascript errors. Have done setup:upgrade, setup:di:compile, have gone back to developer mode, etc. Nothing seems to work. Any help is appreciated.
UPDATE 2018-08-03 : I figured out the issue I was having. It seems as though a file was not deleted during the update process. I my instance I got two files when running :
grep -rnw . -e 'as="content"' --exclude-dir var
game me :
./vendor/magento/module-product-video/view/adminhtml/layout/catalog_product_form.xml:21: <block class="Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery\Content" as="content">
./vendor/magento/module-product-video/view/adminhtml/ui_component/product_form.xml:34: <block class="Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery\Content" as="content">
ls -al ./vendor/magento/module-product-video/view/adminhtml/layout/
-rw-r--r-- 1 aaa aaa 1680 Sep 13 2017 catalog_product_form.xml
-rw-r--r-- 1 aaa aaa 390 Jun 25 09:44 catalog_product_new.xml
I ran :
mv ./vendor/magento/module-product-video/view/adminhtml/layout/catalog_product_form.xml ~/.
and it works fine now. I checked a new download of 2.2.5, and it did not contain this file. I hope this helps someone else.
Thank you @sahava! I still had this problem in v2.3.3, but after renaming /vendor/magento/module-product-video/view/adminhtml/layout/catalog_product_form.xml and flushing cache the Add Video button works again. Very helpful thank you!