Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

Saving the store address is not working #695

Open
johnkrovitch opened this issue May 25, 2016 · 2 comments
Open

Saving the store address is not working #695

johnkrovitch opened this issue May 25, 2016 · 2 comments

Comments

@johnkrovitch
Copy link

Hi,

I'm trying to change the address of the store, but nothing is happening. The backoffice says that the store is saved, but in database, no changes are done.

It seems like the relation between Store and Address is missing the cascade attribute, but even with this attribute, it is not working.

If someone has an idea. I try to make a PR if I find a solution.

Thanks

@johnkrovitch
Copy link
Author

The problem seems to be in the StoreBundle\Controller\StoreController :

   /**
     * Save store and add success flash
     *
     * @param StoreInterface $store Store
     *
     * @return $this Self object
     */
    private function saveStoreAndAddFlash(StoreInterface $store)
    {
        // replacing this existing code
        $this
            ->get('elcodi.object_manager.store')
            ->flush($store);

        // by this one will save the address changes in database
        $this
            ->get('elcodi.object_manager.store')
            ->persist($store);

        $this
            ->get('elcodi.object_manager.store')
            ->flush();

        $this->addFlash(
            'success',
            'admin.store.saved'
        );

        return $this;
    }

@johnkrovitch
Copy link
Author

It is maybe not the good place to make PR ?

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

1 participant