Page 1 of 1

CGBetterforms --> Debug message

Posted: Sat Oct 06, 2018 10:58 am
by Gregor
Using CGFB versoin 1.7 I noticed the following error:
Debug: (0.252318) - (net usage: 8640928) - (peak: 9083296)

test1 inschrijven - inschrijven
It seems to be related to this piece of code, however this is a unchanged piece of code and in place since prior versions of CGFB.

Code: Select all

<div class="row">
        <label><input class="radio-inline" type="radio" name="mailing" value="inschrijven" data-cgbf-label='Inschrijven' data-cgbf-selected={$form_data->mailing|default:'inschrijven'}>   Inschrijven</label>
        <label><input class="radio-inline" type="radio" name="mailing" value="uitschrijven"/>   Uitschrijven</label>
    </div>
In doing a search on "test1", I got to the class.FormRenderer.php line 131:

Code: Select all

$nodes = $this->getInputsByType('radio');
        if( $nodes ) {
            foreach( $nodes as $node ) {
                $tmp = $this->getAttributesArray( $node->attributes );
                if( !($attr = $node->getAttribute('data-cgbf-selected')) ) continue;
                debug_display('test1 '.$attr.' - '.$node->getAttribute('value'));
                if( $node->getAttribute('value') == $attr ) $node->setAttribute('checked','checked');
            }
        }
Any idea what is needed to solve the given error?

Re: CGBetterforms --> Debug message

Posted: Sat Oct 06, 2018 11:09 am
by Rolf
You can disable the debug message by adding //

Code: Select all

//debug_display('test1 '.$attr.' - '.$node->getAttribute('value'));
But please post a bug report for the developer in the Forge so he can fix this in the SVN and it will be shipped in the next module release.

grtz. Rolf

Re: CGBetterforms --> Debug message

Posted: Sat Oct 06, 2018 12:09 pm
by Gregor
Rolf wrote:You can disable the debug message by adding //

Code: Select all

//debug_display('test1 '.$attr.' - '.$node->getAttribute('value'));
But please post a bug report for the developer in the Forge so he can fix this in the SVN and it will be shipped in the next module release.

grtz. Rolf
Modifying module files... :)
I'll create a report

Re: CGBetterforms --> Debug message

Posted: Sun Oct 07, 2018 10:59 am
by Rolf
Gregor wrote:Modifying module files... :)
Correct.
Disabling one debug line in a file is in my opinion pretty different than an unsupported "fix" from a bug in a module. A "fix" that can get others in trouble later...

Re: CGBetterforms --> Debug message

Posted: Sun Oct 07, 2018 3:59 pm
by Gregor
Rolf wrote:
Gregor wrote:Modifying module files... :)
Correct.
Disabling one debug line in a file is in my opinion pretty different than an unsupported "fix" from a bug in a module. A "fix" that can get others in trouble later...
Just kidding :)