Slides have been replaced with Warning message

Permalink Browser Info Environment
On this page:
http://www.idevicesinc.com/

The Formigo slider is not showing up. Instead there is this message:

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/ishowerinc.com/idevices/blocks/formigo_slider/templates/home_page/view.php on line 57

This is the 2nd time this has happened. Can you tell me:

1. What are we doing that is causing this?
2. Can I revert to a previos version of the slides so I don't have to build them again?

Thanks.

Type: Discussion
Status: New
kreative
View Replies:
formigo replied on at Permalink Reply
formigo
I suspect you have an early version of the block, which contained a bug, whereby the slides got disassociated with the block in some scenarios.

The latest version in the marketplace, which you should be able to download under transactions/licenses in your concrete5 'My Account' has this problem fixed.

In terms of reassociating the slides this is possible, you need the current id of the block, so place this code in the blocks view.php
<?php echo $this->bID;?>

And then find your slides in the database table btFormigoSliderSlides and update the slideBlockID to the new value found above.

But you'll want to upgrade as this could happen again and is fixed in the current version.

Best

Ollie
kreative replied on at Permalink Reply
kreative
Thanks for the reply. I have 1.0.2 installed and that looks to be the current version already. I'll implement the "fix" but is this still a bug in the current version?
formigo replied on at Permalink Reply
formigo
It is the current version. The bug I was referring to has indeed been fixed in that version.

We tested extensively, so I think whilst the symptoms are the same this may be something different.

Can you give us some more details about what you/user was doing at the point this occurred?
kreative replied on at Permalink Reply
kreative
This was the second time this has happened. I asked the user what he was doing prior to the error and this was his response:

"I made changes to other pages. I then went into the index page in edit mode. I click on the slider and hit edit. I looked at the settings and saw there was nothing I wanted to touch so I hit save to leave. I then went to leave the page and hit discard my edits instead of publish. At that point the sliders were lost. I check on the last time the issue occurred and it also happened when discards my edits was used although in the previous case changes were actually made to the sliders. I believe an image was swapped that time."
formigo replied on at Permalink Reply
formigo
Ok that's helpful. We're using the standard duplicate method to drive the slide updates. But If I'm absolutely honest, 'discard edits' wasn't tested as we didn't forsee a problem.

We'll have a look and put out an update. In the meantime if you need any help at all identifying the current block version and reassigned to the slides let me know. I realise it's a production site so important. I'll need C5, FTP and DB Access (sent via PM not in this thread)

Best

Ollie
formigo replied on at Permalink Reply
formigo
Sorted. Look out for the update, we'll get to the bottom of that, but in the meantime please advise client to cancel rather than save on the block if they make no changes.

Also, I've a left the single commented-out piece of code in the block controller's view method. Uncommenting that will give you the block id should it happen again before we patch it.

Nice looking site. Great to see our slider used on there!

Best Ollie

(Sent via PM also)
kreative replied on at Permalink Reply
kreative
Sorry for taking so long to respond. Thanks for your help on this. Much appreciated.
kreative replied on at Permalink Reply
kreative
Where do I put the code within the view.php file in order to get the bID?

And where would I see the result? On the page the slider appears on?
formigo replied on at Permalink Reply
formigo
Anywhere in the view.php file should be ok. Probably towards the top of the output best.
Elstud replied on at Permalink Reply
Elstud
Same probleme.
I Think it's something like that : The problem is with the domain "www" or not.
http://www.domain.com is OK bushttp://domain.com is not.
htarlov replied on at Permalink Reply
htarlov
Plugin in version 1.0.4 doesn't work well with versioning. It changes ID of entries in slides table (btFormigoSliderSlides) instead of copying them (so there could be a set of entries for each version of the block).

I did a quick patch on one of our pages that use this plugin (in block's controller):

private function syncSlides($newID,$curID) {
        $db = Loader::db();
        if ($newID != $curID) {
            $db->execute('DELETE FROM btFormigoSliderSlides WHERE slideBlockID = ?', array($newID));
            $db->execute('INSERT INTO btFormigoSliderSlides (slideBlockID, slideTemplate, slideText, slideImage, slideImageAltText, slideOrder, slideActive) SELECT ?, slideTemplate, slideText, slideImage, slideImageAltText, slideOrder, slideActive FROM btFormigoSliderSlides WHERE slideBlockID = ?', array($newID, $curID));
        }
    }

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.