Jump to content

1.7.0.5 Multistore Link Widget Problems


ubv

Recommended Posts

There are several problems with the Link Widget module in 1.7, it's just not working properly, too many errors to mention here in detail, but involving the second language customer content and titles in second languages, as well as all the pages being listed 4 times!

 

One problem is very acute however. I added a new Link Block and it didn't appear in the back office. However it did appear in the front office, and now I can't delete or edit it, because I can't see it in the back office.

 

I have deleted the cache, and also tried removing the widget from the hook and reattaching it, but the error persists.

 

I'm not sure how to go about deleting/editing the content.

 

Can anyone help, or has anyone had the same problem?

 

Thanks!

Link to comment
Share on other sites

Thanks, we finally managed to get rid of it by uninstalling and installing the module again. Good to know that's it's possible using phpMyadmin though, we might have to use it when the module breaks again, which is probable, based on our experience so far. 1.7 was not ready for release at all! Every day we come across new problems.

  • Like 2
Link to comment
Share on other sites

  • 8 months later...

I've done some modifications in LinkBlockRepository.php getIdByHook function:

 

 public function getByIdHook($id_hook, $id_shop = null)
    {
        $id_hook = (int) $id_hook;
        $id_shop = (int) (($id_shop) ?: Context::getContext()->shop->id);

        $sql = "SELECT cb.`id_link_block`
                    FROM {$this->db_prefix}link_block cb
                      LEFT JOIN {$this->db_prefix}link_block_shop lbs ON lbs.id_link_block = cb.id_link_block
                    WHERE `id_hook` = $id_hook AND lbs.`id_shop` = $id_shop
                    ORDER by cb.`position`
                ";
        $ids = $this->db->executeS($sql);

        $cmsBlock = array();
        foreach ($ids as $id) {
            $cmsBlock[] = new LinkBlock((int)$id['id_link_block']);
        }

        return $cmsBlock;
    }

It doesn't solves the admin part but the prublic pages shows up in correct store. You shoud edit the blocks using phpmyadmin until final upgrade arrives.

Link to comment
Share on other sites

  • 1 month later...

Thanks Reho.

Using that prevents in my case same page showing up 3 times in the bloc (I have 3 stores).

However, only one of the shop shows the page : the one I last clicked on save. Selecting the proper store context doesn't help. Only one shows the links : the last saved.

I tried looking in the tables (CMS, Link_block...) but all seems ok. I don't know what to change to get each page appearing in its own store link block ...

Thanks

Link to comment
Share on other sites

  • 2 months later...

This is just one of the many issues you will encounter with Multistore.

To make it short, Multistore is a big joke : it does not work at all.

We have stopped struggling with unwanted merges of our stores and created many standalone stores...

Link to comment
Share on other sites

Hi everyone

i have a solution for link widget, isn´t completely finished, because still missing that one block can be attached to more than one store.

Solution

- First you have to copy de file LinkBlockRepository.php into directory /modules/ps_linklist/src/ and replace it, is the same file, only i made a few changes.

- Second you have to execute the sql sentence INSERT INTO `PREFIX_link_block_shop` (`id_link_block`, `id_shop`) VALUES (id_block, id_shop);  for each block you have replacing the green values.

- Third create block for each store.

LinkBlockRepository.php

Link to comment
Share on other sites

  • 1 year later...
On 3/29/2018 at 5:45 PM, Alejandro del Valle said:

Hi everyone

i have a solution for link widget, isn´t completely finished, because still missing that one block can be attached to more than one store.

Solution

- First you have to copy de file LinkBlockRepository.php into directory /modules/ps_linklist/src/ and replace it, is the same file, only i made a few changes.

- Second you have to execute the sql sentence INSERT INTO `PREFIX_link_block_shop` (`id_link_block`, `id_shop`) VALUES (id_block, id_shop);  for each block you have replacing the green values.

- Third create block for each store.

LinkBlockRepository.php

I tried to follow this but didnt work still...

 

it shows all blocks created in all shops ...

Link to comment
Share on other sites

On 12/4/2017 at 12:21 PM, Reho said:

I've done some modifications in LinkBlockRepository.php getIdByHook function:

 


 public function getByIdHook($id_hook, $id_shop = null)
    {
        $id_hook = (int) $id_hook;
        $id_shop = (int) (($id_shop) ?: Context::getContext()->shop->id);

        $sql = "SELECT cb.`id_link_block`
                    FROM {$this->db_prefix}link_block cb
                      LEFT JOIN {$this->db_prefix}link_block_shop lbs ON lbs.id_link_block = cb.id_link_block
                    WHERE `id_hook` = $id_hook AND lbs.`id_shop` = $id_shop
                    ORDER by cb.`position`
                ";
        $ids = $this->db->executeS($sql);

        $cmsBlock = array();
        foreach ($ids as $id) {
            $cmsBlock[] = new LinkBlock((int)$id['id_link_block']);
        }

        return $cmsBlock;
    }

It doesn't solves the admin part but the prublic pages shows up in correct store. You shoud edit the blocks using phpmyadmin until final upgrade arrives.

Can u please copy the whole file after modification ,,,, or tell where exactly to make this modification ??

Link to comment
Share on other sites

  • 1 year later...
  • 2 months later...
On 6/18/2020 at 4:55 PM, VTR1000 said:

It's almost 3,5 years later and this bug is still present in the current version.

Has anyone found a fix?

 

The error does not occur if the employee has the same language as the store's language. In other words, Back Office must have the same language as Front Office.

[ My Presta: 1.7.6.2 ]

Link to comment
Share on other sites

  • 3 months later...

Happy New 1.7.7.0, guys!

It is time to solve jurrasic issues, so, what we`ve got...

DB structure for ps_linklist MultiShop compatibility = thanks Alejandro del Valle

PHP code for it = thanks Alejandro del Valle & Moatazhyper

tell where exactly to make this modification  = "you have to copy de file LinkBlockRepository.php into directory /modules/ps_linklist/src/ and replace it, is the same file"

99% solved... ?

a stumbling block is : Anyone tried it? is it really works?

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...