Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Collection/Fieldset problem after update 2.2.x to 2.5 #73

Open
GyniO opened this issue May 18, 2016 · 1 comment
Open

Collection/Fieldset problem after update 2.2.x to 2.5 #73

GyniO opened this issue May 18, 2016 · 1 comment

Comments

@GyniO
Copy link

GyniO commented May 18, 2016

Hi,

Zend Framework updated to the version 2.5, then came to me mainly problems with collections.
At an earlier version 2.2.x all it worked normally but now I have a problem.

Debugging code form, specifically the data from the form, I found two types of data received.

2.2.x:

'descriptionTabs' => 
    array (size=2)
      0 => 
        array (size=5)
          'id' => int 1
          'name' => string 'raz' (length=3)
          'position' => int 0
          'content' => string '<p>22222222222222222</p>' (length=24)
          '_translation' => 
            array (size=1)
              'en_GB' => 
                array (size=1)

2.5

'descriptionTabs' => 
    array (size=2)
      0 => 
        array (size=5)
          'id' => int 1
          'name' => string 'raz' (length=3)
          'position' => int 0
          'content' => string '<p>22222222222222222</p>' (length=24)

In 2.5 I'dont see a field _translation, but forms on the front look the same field names as well.

Entity use

    /**
     * @Form\Attributes({"data-collection-max-count":5})
     * @ORM\OneToMany(targetEntity="CmsShop\Entity\Product\DescriptionTab", mappedBy="product",cascade={"all"})
     * @ORM\OrderBy({"position" = "ASC"})
     */
    protected $descriptionTabs;

Entity

class DescriptionTab implements Sortable {

    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\Column(type="string",nullable=false)
     * @Gedmo\Translatable()
     */
    protected $name;

    /**
     * @Gedmo\SortablePosition
     * @ORM\Column(type="integer",nullable=true)
     * @Form\Type("hidden")
     */
    protected $position;

    /**
     * @Form\Type("html")
     * @Gedmo\Translatable()
     * @ORM\Column(type="text", nullable=true)
     */
    protected $content;

Anyone have any idea how to solve it?

@michalbundyra
Copy link
Member

This repository has been closed and moved to laminas/laminas-form; a new issue has been opened at laminas/laminas-form#45.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants