Skip Navigation

[Résolu] After Layouts-update child-wrapping (ddl_render_row_start) not working anymore

This support ticket is created Il y a 6 années et 12 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 6 réponses, has 2 voix.

Last updated by dianaM-4 Il y a 6 années et 12 mois.

Assisted by: Luo Yang.

Auteur
Publications
#508471

I am trying to update all of my Toolset-plugins, but the Layouts-update breaks my layout. I found out, that it's because my filter, which is wrapping my child-layouts in a content-div, doesn't work anymore. So I guess, this hook changed in the new version?

Here is my code:

// Adding a content-div around child-layouts, before #leading and #footer
add_filter('ddl_render_row_start', 'wrap_child_layout', 999, 2);
function wrap_child_layout( $row, $args) {
    if( isset($args['cssId']) && $args['cssId'] == 'footer' ){
        $row = '</div>' . $row;
    } else if( isset($args['cssId']) && $args['cssId'] == 'leading'){
        $row =  '<div id="content">' . $row;
    }
    return $row;
} 

Everything worked till the update. Now my #content-div disappeared ...
Please for help!

#508788

Dear Diana,

The filter hook "ddl_render_row_start" locates in Layouts plugin file \layouts\classes\wpddl.layout-render.class.php, line 252:

        $this->output .= apply_filters( 'ddl_render_row_start', ob_get_clean(), $args, $row, $this );

I just compared the lated version of Layouts plugin 1.9.3 with version 1.9.1, the above codes are same, nothing changed, since the problem you mentioned above is a custom codes problem, please check these first:
1) deactivate other plugins and switch to wordpress default theme, and test again
2) Enable PHP debug mode, copy and paste the debug logs here
PHP Debugging
In case you think that Types or Views are doing something wrong (what we call a bug), you should enable PHP error logging. Again, edit your wp-config.php file and add the following:

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
This will produce a file called ‘error_log.txt’ in your WordPress root directory. Make sure that the web server can create and write this file. If it cannot, use an FTP program to create the file and make it writable to Apache (normally, user www-data).
https://toolset.com/documentation/user-guides/debugging-types-and-views/

If the problem still exists, please provide a database dump file in below private detail box, I need to duplicate same problem and debug it in my localhost, thanks

#508867

I'm sorry, I made a mistake when uploading my database. If you really need it, please provide me a new private message box. But I'm not sure, what you are able to test with only the database and without my template, especially without functions.php? I could also provide you an UpdraftPlus-backup of my whole site if you need ...

Here what I found out in the meanwhile:
With only Toolsets plugins activated – still no surrounding content-div.
Switched to Toolsets Starter Theme and added the above code – still no change.
And no errors in my error-log.

So the hook doesn't work and the error is in its code, isn't it?
Isn't it important, in which order $row and $args are called in the hook?
And does the argument "cssId" still exist or is there a new name for it?

#509171

Please test your custom codes in a wordpress installation with original Toolset Starter theme, but without other plugins.

If the problem still exists, please provide a database dump file in below private detail box, I need to duplicate same problem and debug the codes in my localhost, thanks

#509234

Thanks for the details, I am downloading the file, will feedback if there is anything found

#509247

Please try to modify your PHP codes as below, and test again:

add_filter('ddl_render_row_start', 'wrap_child_layout', 999, 4);
function wrap_child_layout( $out, $args, $row, $renderer) {
    if( isset($args['cssId']) && $args['cssId'] == 'id="footer"' ){
        $out = '</div>' . $out;
    } else if( isset($args['cssId']) && $args['cssId'] == 'id="leading"'){
        $out =  '<div id="content">' . $out;
    }
    return $out;
} 
#509689

Thanks, Luo!
The new code is now working again!
Best regards, Diana

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.