Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

One of the websites I help maintain uses an older version of PrestaShop (1.4.6.2) and since enabling SSL I've noticed that the BlockCMS module editor hasn't been behaving very well. Specifically, it wasn't showing any of the CMS pages that were created so it wasn't possible to select what links were shown on the shop's sidebar.

The BlockCMS editor had everything except for the section that let you pick which pages to display in the block...
blockcms_1.png


What I saw when I opened the developer console explained everything. The browser was blocking non-SSL content that the BlockCMS module was requesting. The blockcms.js JavaScript file was the one being blocked and that file is responsible for providing functions that populate the BlockCMS editor.
blockcms_2.png


After some digging around I found the problem. It was in the modules/blockcms/blockcms.php file.
blockcms_4.png




The _displayAddForm() function was hard-coded to use PS_BASE_URL when adding JavaScript files to a page. It should have detected whether SSL was enabled and used an appropriate base URL instead. Since I knew that I wasn't going to switch SSL off, I replaced that with PS_BASE_URL_SSL and saved the file (this is just a quick fix, I didn't want to spend time on the correct fix that detected SSL settings).
blockcms_3.png


After making that change and refreshing the BlockCMS editor, all of the CMS pages were now visible and I could again select what was shown and what wasn't!
blockcms_5.png


-i

Skip down to comments...
A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. If you spot something out of place, please do let me know.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
 
comments powered by Disqus
Other posts you may like...