Skip to content

Impossible to create Text Swatch 0 (Zero) #9619

@orozcodiaz

Description

@orozcodiaz

Preconditions

  1. Magento 2.1.6
  2. PHP 7.0.14-2a

Steps to reproduce

Try to create product attribute text swatch with value "0" (zero)

Expected result

New value for attribute

Actual result

Admin is a required field in the each row

To see recorded behaviour: http://recordit.co/bUwOLQQ3n2

screen shot 2017-05-12 at 5 30 36 pm

After saving:

screen shot 2017-05-12 at 5 30 53 pm

Quick Fix

module-swatches/Model/Plugin/EavAttribute.php

Method isOptionsValid()
Instead of this:
if (empty($option[0])) { return false; }

Type this:
if($option[0] != '0'){ if (empty($option[0])) { return false; } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions