Image Slider failing in Composer

Permalink
Hi all!

I have tried to add an Image Slider block into the composer to enable an easier UI for a customers website.

When you open the composer, your get the spinning wheel permanently and the Save/Publish buttons do not appear. I have narrowed this down to the following section of code in the block, but even when removing this the Image Slider block doesnt work properly in the Composer.

The code starts at line 141 in the form_setup_html.php file.
$(function() {  // activate redactors
            $('.redactor-content').redactor({
                minHeight: '200',
                'concrete5': {
                    filemanager: <?php echo $fp->canAccessFileManager()?>,
                    sitemap: <?php echo $tp->canAccessSitemap()?>,
                    lightbox: true
                }
            });
        });

Can anyone advise or help?

thanks

Simon.

dclmedia
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi dclmedia,

Are you using a custom theme?
dclmedia replied on at Permalink Reply 1 Attachment
dclmedia
Hi!

I have managed to solve this problem as well as customising Image Slider to store a unique ID to refer to the page as everytime you update in composer it updates the block number which in turn then kills the reference to the images stored. Basically I have got it working, to a fashion!

The problem I now have is when I return to composer to update the page details as I would prefer to use for my clients (tell them one place to go for adding and editing and they are less likely to mess it up!) but the images that I have added do not show in the composer window. It would appear that when you go enter composer, the following function in the controller.php file doesn't get called
public function edit() {
        $this->requireAsset('core/file-manager');
        $this->requireAsset('core/sitemap');
        $this->requireAsset('redactor');
        $db = Loader::db();
        $query = $db->GetAll('SELECT * from btPropertyDetailsImages WHERE pdtID = ? ORDER BY sortOrder', $this->pdID);
        $this->set('rows', $query);
    }

as such it doesnt then populate the Array 'rows' which is required to render the images in the editor (see attachment).

If I could figure out how to at least run this
$db = Loader::db();
        $query = $db->GetAll('SELECT * from btPropertyDetailsImages WHERE pdtID = ? ORDER BY sortOrder', $this->pdID);
        $this->set('rows', $query);
it would all work beautifully!
andrew replied on at Permalink Reply
andrew
I believe this is a bug. I have committed what I believe will fix this issue. Check out this commit:

https://github.com/concrete5/concrete5-5.7.0/commit/0a6c2cc9c8e76040...