WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: KonTrax on May 03, 2009, 11:42:16 PM

Title: Droplet Modul Parameter FIX
Post by: KonTrax on May 03, 2009, 11:42:16 PM
I've found a small unpractical flaw in the original Droplet script.

If you use two droplets with the same parameter variables on the same site, the secound one will not use default values for its optional parameters. I've fixed this with this small fix by unsetting the parameter variables after use.

WARNING! This is not a fully tested method so try it out on a test version of your WB system before utilizing it.!

If you would like to utilize this fix all you have to do is two small copy pase in the droplet core file (/modules/droplets/droplets.php)

Paste this into line 28
Code: [Select]
                           //////////////////////////////////////////////////////
                            // Fix by KonTrax at KonTraxNET
                            // Droplet parameter variables fix dropp one
                            if(!isset($cleanDropI) || empty($cleanDropI)){$cleanDropI=0;}
                            $cleanDropVars[$cleanDropI]=$parameterTemp[0];
                            $cleanDropI++;

Paste this into line 51
Code: [Select]
                           //////////////////////////////////////////////////////
                            // Droplet parameter variables fix dropp two
                            foreach ($cleanDropVars as $cleanDropII) {
                                if(isset($cleanDropVars)){
                                    unset($parameter[$cleanDropII]);
                                }
                            }