Campaign setup page hook help needed

Raydar

Member
Hi,

I made some changes to the core file of mailwizz which i would like to render through the init-custom file instead due to future upgrade. I'm a semi-tech guy so i'm kinda lost here. What do i need to do to make my code in init-custom.php render instead. The picture below is what i would like to replicate.

Help @twisted1919.
Screenshot 2023-07-13 at 8.24.33 PM.png
 
I tried writing this code for a start to see if it will work on the page, but it's not working. What am i missing?

PHP:
Yii::app()->hooks->addAction('before_active_form', function($collection){
    
    if (!Yii::app()->apps->isAppName('customer')) {
        return;
    }
    if ($collection->controller->route != 'campaign/setup') {
        return;
    }
     // do not render the default mailwizz form
    $collection->renderForm = false;
 
    // make all variables defined in controller available
    extract($collection->controller->data->toArray(), EXTR_SKIP); // Convert CAttributeCollection to array
 
    $form = $collection->controller->beginWidget('CActiveForm');
    ?>
        <div class="box box-primary borderless">
            <div class="box-header">
                <div class="pull-left">
                    <h3 class="box-title">
                        <?php echo IconHelper::make('cog') . $pageHeading; ?>
                    </h3>
                </div>
                <div class="pull-right">
                    <?php echo CHtml::link(IconHelper::make('cancel') . t('app', 'Cancel'), ['campaigns/index/setup'], ['class' => 'btn btn-primary btn-flat', 'title' => t('app', 'repeat')]); ?>
                </div>
                <div class="clearfix"><!-- --></div>
            </div>
            <div class="box-body">
            <?php $collection->controller->endWidget(); ?>
            <?php
                
});
 
I did that, and i got this error on the page "

Call to a member function labelEx() on null​

". Any idea what caused that.
 
Back
Top