Jump to content
ubv

1.7.0.5 Multistore Link Widget Problems

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!

Share this post


Link to post
Share on other sites

Check the ps_link_block, ps_link_block_lang and ps_link_block_shop tables in your database using phpMyAdmin. Hopefully, you can manually delete the block from there.

Share this post


Link to post
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 1

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Hello,

I am newbie here. In my multi-store the link widget is not working as expected.  I can not set different links for different store. It is showing the same url for both store. Can you help please ?

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
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 ...

Share this post


Link to post
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 ??

Share this post


Link to post
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

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More