Block Layouts problem v1.4

edited May 2017 in Bug Reports

recently updated one of my sites to version 1.4, this site use block layouts like in daylight-roasters site (source).

By the way, thanks for this example it was very useful.

In general, when saving a page with blocks, an error occurs:
Severity: Warning

Message: explode() expects parameter 2 to be string, array given

Filename: controllers/Pages.php

Line Number: 1219

Here is this line:
$field_name_parts = explode('--', $field_name);

Although an error occurs, the data is still stored...

This var seems to be empty when saving, so I replaced this entry:
$field_name_parts = (!is_array($field_name)) ? explode('--', $field_name) : $field_name;

Now the page saves without error.

There is one more problem with block layouts and caching:

One of my blocks have a field with type multi and in view file there is a function that shuffle selected records and everytime the page is refreshed, these records shuffle again...
Also, every time when the page is refreshed, a new file in app\cache\dwoo\compiled appears!

This problem only occurs if use block layouts, when saving page without blocks caching works as expected.


  • edited 1:47AM
    Thanks for the report. The develop branch actually already has a fix for that in place.

    Regarding your shuffling issue, because the HTML output for those files is different on page refresh, the compiled HTML will be generated until the same random permutation. If you are using the fuel_block function, there is a "parse" parameter that by default is set to TRUE. Try setting it to FALSE (doing so will not allow you to use any templating code in your block like {img_path('...')}.
  • edited 1:47AM
    Setting "parse" to false did not affect.
    To solve the problem with caching had to use native CI caching on these pages:
    This method has its drawbacks, had to disable inline editing and add on_before_save() hook that deletes cache for current page:
    It's good that CI 3 allows to do that.

    Thanks for reply!
Sign In or Register to comment.