magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.54k stars 9.32k forks source link

Error when adding custom attributes: "The value of Admin scope can't be empty." #11263

Closed eharvest closed 6 years ago

eharvest commented 7 years ago

Preconditions

  1. Magento 2.2.0
  2. Linux VPS Ubunut 16.0.4, PHP7

Steps to reproduce

  1. Add new custom attributes and choose drop down
  2. Add attribute value
  3. Add more than one empty fields then delete the empty fields
  4. Save Attribute

Expected result

  1. Attribute saved successfully

Actual result

  1. Unable to save attribute, error message: The value of Admin scope can't be empty.

    I think it's a common practice to add a few option fields then fill in the value - it's a quicker way of creating attributes. However it looks like after you delete the extra empty option fields, Magento still remembers those fields hence fires the error message. I have a few 2.1 stores and I'm pretty sure this is new to Magento 2.2.

magento-engcom-team commented 7 years ago

@eharvest, thank you for your report. We've created internal ticket(s) MAGETWO-81081 to track progress on the issue.

patrikpihlstrom commented 7 years ago

I can work on this if nobody else is.

iTea2 commented 7 years ago

We replicated the bug.

ruiwant commented 7 years ago

When i create a dropdown with lots of values, i always got the error 'The value of Admin scope can't be empty', @eharvest is right. When you remove any of the empty option fields, the bug will show.

I have no idea how to solve the bug, but if you just add lots of values, the bug will let you so pain. There is a method, you can open you firebug and delete the empty no-display option fields, then you can save it without any error.

But, I believe it is a bug.

webusat commented 7 years ago

I can confirm that I have the same issue in 2.2.0 when I create empty option boxes and then delete them. If I open dev tools in Chrome and delete those elements it will save.

Thanks.

diptihere commented 7 years ago

This is issue with 2.2.0 . Until this issue gets resolved completely, for time being we can clear all caches, go back to attributes page and again open the same attribute then try to save it. It worked for me.

webusat commented 7 years ago

I have the Cache disabled and still had to open dev tools and delete the element for it to save.

Ralfefernandes commented 6 years ago

I had also the same issues. By running those commands all the problems was gone. php bin/magento index:reindex php bin/magento setup:static-content:deploy -f

jwgraves2 commented 6 years ago

Same issue here.

aron0904 commented 6 years ago

Any update on this? Magento 2.2.1 and doing this as well.

Would appreciate if anyone has a way to get this fixed.

webusat commented 6 years ago

I am on 2.2.0 and still have to open developer, find the empty field, right-click and delete it and then save. That works for now.

aron0904 commented 6 years ago

So it works only in developer mode? right click and delete? Confused by this. If you can share a screenshot would appreciate.

webusat commented 6 years ago

View the page using developer (right click on the admin page and select inspect) find the field and right-click the field and select delete element from the dropdown. Then save. screen shot 2017-12-04 at 9 14 54 am

brplassen commented 6 years ago

Still having this issue in 2.2.2

s-hajir commented 6 years ago

Still having this issue in 2.2.2

alexstain commented 6 years ago

Having the issue. Can't find the line to delete in chrome consol. php bin/magento index:reindex php bin/magento setup:static-content:deploy -f <-- no effect

haq0003 commented 6 years ago

this solution work for me,

duffner commented 6 years ago

@magento-engcom-team, Is there any update on this issue?

sidolov commented 6 years ago

Hi @eharvest , i can't reproduce this issue on current 2.2-develop branch

duffner commented 6 years ago

@sidolov, @magento-engcom-team, @eharvest @patrikpihlstrom

I've tested on both an OpenSource Magento 2.2.3 and Commerce edition 2.2.3 and this issue is easily reproducible. I think the steps were followed too literally in testing.

  1. Install Magento with Sample Data
  2. Go-to Stores -> Attributes -> Product
  3. Select an existing Dropdown or Swatch attribute such as color
  4. Add two options, Fill the first out as "Purple Mountain", leave the second option empty, save the product
  5. Error Expected (Admin Field cannot be left blank)
  6. Remove unfilled/empty option to correct for "Admin Field cannot be left blank" error caused accidentally adding too many new attribute options.
  7. Save Product
  8. Error Received "The value of Admin scope can't be empty." UNEXPECTED RESULT!
  9. Expected Result -> Product saves without error, and new attribute option "Purple Mountain" is added.

Note: Refreshing the page and losing all of your work is now the only way to save this attribute. Saving the product in step 4 is not a required step, I did it to emphasize the difference between an expected error and an unexpected one with the same message.

If you've added a 100 new values by hand as a Magento Admin, you'd be very angry that you'd have to refresh the page and start over.

If you cannot reproduce the issue, please at least give one day for someone to provide clarity before closing this ticket.

To be clear, this is a valid and unacceptable error

afavata commented 6 years ago

Same behaviour with Magento 2.2.3..... Unfortunatly I have to refresh and reenter all the datas in the dropdown list.

ghost commented 6 years ago

Typically magento fail. 3 branches and stable versions ahead and still the same bullshit. Yes I have the same issue but i have 5 the same issues from magento2 that are unsolved. Some of these problems are a few years old. Even Duplicated contend isn't solved in 2.2.3 Wow I am starting to hate this beta platform (magento) more and more every day but we all have to deal with it. Seems like they have benefit by keeping these problems going so the overpriced too expensive programmers can gain huge profits from it. Well I am not going to pay for basic software that should run out of the box even after data migration with a tool which is designed for this software. I hope the Chief Executive Officer of magento is aware of this way of working and the process to get things done within magento. Because his strategy fails since the beginning of magento. The only good stable magento I ever used was magento 1.9.2.3. Too little too late. Now we are back to the start of putting hours and hours in reading forum posts and having the mind full of problems that should not be there in magento 2. Every one who wants to start with magento without a Dump truck full of money I suggest to go to another platform. Because you are wasting your time and so profit to get a beta platform working. For the ones with a dump truck full of money, send in two of them to get ready and free of problems in your time frame to gain profit. Good luck.

elangosundar commented 6 years ago
  1. Deleted the attribute is not deleted properly.
  2. So delete the attribute properly and create the same attribute correctly.
  3. Now check, issue will be resolve.
ryanpalmerweb commented 6 years ago

I've experienced this several times in the last few days on a base installation of Magento.

I must say, quite disappointed to have experienced two major bugs that have needed extensive debugging, on a platform without any modifications, plus a load of UI glitches on top.

Clearly it's not in a state where it should have been placed in production.

GeorgeBogdanA commented 6 years ago

We've had the same issue on Magento 2.2.4 under php 7.1.17 with Plesk 17.8.11 but we've discovered that there was an error on the cron tasks of Magento: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2359296 bytes) in /var/www/vhosts/**./magentodomain.***/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php on line 352. After we've fixed the cron error, the issue disappeared.

evagabond commented 6 years ago

Experiencing this weird issue on M2.2.3, @webusat fix worked for me. Thanks!

sergiirepin commented 6 years ago

Also you can clean directly via db, just clear table eav_attribute_option by attribute_id It will help to avoid issue in future.

brplassen commented 6 years ago

I love Magento 2 because I understand the database structure, and dependency management, but what about a noob with a brilliant idea? It seriously needs a better guide for it's functionalities for noobs. The installation and management can be done far better(without loosing console management), like Joomla.

Den fre. 13. jul. 2018, 09.37 skrev Sergey Repin notifications@github.com:

Also you can clean directly via db, just clear table eav_attribute_option by attribute_id

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/magento/magento2/issues/11263#issuecomment-404752487, or mute the thread https://github.com/notifications/unsubscribe-auth/AKjSqsIcyVFvyUGz8e5ECkwO6oBdqfSMks5uGE40gaJpZM4Pv9mk .

ghost commented 6 years ago

@brplassen Yes, Lots and lots of Developers love and adore Magento 2 to gain huge profits out of the unknown. I am fighting against this because open source should not be a product to gain huge amount of profit from if there are problems in final versions. Otherwise they should change the name to open money machine. And i know this because i was one of the unknown and they drained me for 17834,40€ without proper results a lot of wasted time (tickets) and frustrations. Lots of so called developers are not magento experts, they have basic knowledge. If the problems get to big they tell that the customer is the problem or they go silent forever after taking your money.

I found out many of the issues in a clean install of magento 2 are even not solved in version 2.2.5. People are depending on Developers which are laughing out loud with these issues and claim hours and hours of work with prices that ar far away from reasonable (in The Netherlands for sure). And yes there are good developers too. Developers that build a problem free magento package themselves so customers don't have to pay for these problems. But it seems to be a handful of Developers working like this. Not to mention the people who provide themes and extensions. Take for example Porto theme, the installation of this theme can only done by a developer. It is the most sold theme of Themeforest. Because the developers are telling this is the best theme to work with. And when people are running in to all kinds of problems, which there are with this theme. The Clock starts ticking and the money tap is flowing right inside the pocket of the developer.

The only way to make magento (2) a platform for everyone is when the creators and the community are working together with the good developers. So the developers can sell complete and working simple magento solutions for those who need this and not to forget those who wants a affordable solution. This can be done quick and easy this way. And besides these developers can offer complete custom work solutions without working on a platform that doesn't function out of the box. So if upcoming magento 2 versions are clean of all the bugs and issues so no developer can use it as a money machine again maybe it can be something good and more affordable for every one.

eharvest commented 6 years ago

@koopjesboom I totally understand the feeling in your guts about Magento. I'm a developer in Australia and in the past three years I devoted myself to Magento2 developing but I've only ever built 4 Stores, one in Magento1 and three in Magento 2. I can easily make triple the money by working at any local supermarkets rather than a Magento 2 developer.

I started to use Magento on 2.0.7 There will be a long list if I want to say how much I hated Magento 2, so I just name a few:

So from what I've encountered, Magento is only good for one thing: if you're doing ongoing support for production stores, you will get endless job because of the endless problems. But good luck getting your project into production.

Unless Magento changes the CE to an affordable paid solution so they can afford to hire proper developers (or pay current contributors), or someone have the balls to buy CE out completely and rebuild it. There will be no joy for Magento developers, you will always be working in fear, doubts and frustration, endlessly... I just don't get why Magento people are so excited about themselves, our local marketing have been rapidly taken by eBay, Amazon, Neto and Shopify. To me Magento developing is like a dead end.

So ask yourself: why on earth would you put yourself in such career?

paginasweb commented 6 years ago

is sad to know that on 2.2.6 issue still exist, cant be angry because this is a free software but sad because Magento 1 was a really good product, the only issue was speed, but Magento 2 is really having issues unresolved, i hope this and other issues get resolved asap.

Mehran91z commented 5 years ago

I had this problem with saving new attributes (Text Swatch) on Magento 2.1.11 and 2.2.5 too.

I found that we need to fill Admin Description Field for each swatch as well as admin swatch field! even the description field isn't required.

Hope this will help...

Janvh commented 4 years ago

2.3.4 cloud version issue still exist!

ruipns commented 4 years ago

So any solution for this atm? i can't even add a new option to an existing attribute

vickobilandzic commented 4 years ago

I had this problem with saving new attributes (Text Swatch) on Magento 2.1.11 and 2.2.5 too.

I found that we need to fill Admin Description Field for each swatch as well as admin swatch field! even the description field isn't required.

Hope this will help...

this worked for me