Back to ProEvents Support

dhuunghia6211
dhuunghia6211

After php update - when adding a new event - an error is issued:

Trying to access array offset on value of type null /home/admin/web/Domain.com/public_html/plugins/radiantweb/proevents/modules/backend/formwidgets/multidate/partials/_multidate.htm line 24...

At the same time, I can open old content.

ChadStrat
ChadStrat

sorry, what version of php?

dhuunghia6211
dhuunghia6211

ChadStrat said:

sorry, what version of php?

8.0.2

ChadStrat
ChadStrat

hmmm. I'm not able to reproduce that behavior. If you're comfortable doing so, you can email me site address and FTP login / PW (support at goradiantweb dot com), I can FTP in and debug. I don't see off hand why that error would even exist looking at the code of that partial and widget.

dhuunghia6211
dhuunghia6211

Sorry! At the moment, I can't configure access for you showing. screenshot of error:

https://i.vgy.me/YS2lP9.png

ChadStrat
ChadStrat

ugh.. ok. well I can't help you if I can't get visibility into 'why'. the view error doesn't mean much to be honest. please open up /plugins/radiantweb/proevents/modules/backend/formwidgets/multidate/Multidate.php and add the following to line 64:

var_dump($dates);exit;

then reload the create event page and take a screenshot of that dump for me. you can remove the var_dump after.

We may have to have you do this in several places to get to the bottom of things.

dhuunghia6211
dhuunghia6211

ChadStrat said:

ugh.. ok. well I can't help you if I can't get visibility into 'why'. the view error doesn't mean much to be honest. please open up /plugins/radiantweb/proevents/modules/backend/formwidgets/multidate/Multidate.php and add the following to line 64:

var_dump($dates);exit;

then reload the create event page and take a screenshot of that dump for me. you can remove the var_dump after.

We may have to have you do this in several places to get to the bottom of things.

https://i.vgy.me/xKLEkC.png

ChadStrat
ChadStrat

mmm, no that's not correct image. it should simply be a plain white screen that reads like this when you do a var_dump as requested:

Event Dates array(3) { ["date"]=> array(1) { [0]=> string(10) "2021-03-02" } ["sttime"]=> array(1) { [0]=> string(5) "18:42" } ["entime"]=> array(1) { [0]=> string(5) "18:42" } }
ChadStrat
ChadStrat

also, I gave you the wrong file path, it should be:

/plugins/radiantweb/proevents/modules/backend/formwidgets/Multidate.php
dhuunghia6211
dhuunghia6211

I added your code in a file like the following: the result is the same

<?php $id = rand(0,2000000); ?> <?php if ($this->previewMode): ?> <div class="form-control"><?= $value ?></div> <?php else: ?> <a href="javascipt:void(0);" class="btn btn-success adddate<?= $id ?>" style="float: right;" data-id="<?= $id ?>"><i class="icon-white-o oc-icon-plus-circle"></i> Add More</a>

<div id="multidate_dates_<?= $id  ?>" class="multidates_dates">
    <div class="form-inline multidate-input multidate-input_<?= $id  ?>">
        <div
            id="<?= $this->getId() ?>"
            class="multidate"
            data-control="datepicker"
            data-show-time="<?= $showTime ? 'true' : 'false' ?>"
            data-min-date="<?= $minDate ?>">
            <input
                type="text"
                class="multidate-picker form-control align-left input-small"
                autocomplete="off"
                data-datepicker />
                <input
                    type="hidden"
                    id="<?= $this->getId('input') ?>"
                    name="<?= $name ?>[date][]"
                    value="<?= $value['date'][0] ?>"
                    data-datetime-value
                    />

            <?php if ($this->mode != 'date'): ?>
            <input
                type="text"
                id="<?= $this->getId('input') ?>-sttime"
                name="<?= $name ?>[sttime][]"
                value="<?= $value['sttime'][0] ?>"
                class="form-control align-left timepicker"/>

            <input
                type="text"
                id="<?= $this->getId('input') ?>-entime"
                name="<?= $name ?>[entime][]"
                value="<?= $value['entime'][0] ?>"
                class="form-control align-left timepicker"/>
            <?php endif ?>
            <a href="nojavascript...void(0);" onClick="$(this).parent().remove();"><i class="icon-trash-o"></i></a>
        </div>
    </div>
    <?php if(is_array($value['date']) && count($value['date']) > 1){ $i = 0; ?>
        <?php foreach($value['date'] as $date){ ?>
            <?php if($i > 0){ ?>
                <div class="form-inline multidate-input">
                    <div
                        id="<?= $this->getId() ?>"
                        class="multidate field-datepicker"
                        data-control="datepicker"
                        data-show-time="<?= $showTime ? 'true' : 'false' ?>"
                        data-min-date="<?= $minDate ?>">
                        <input
                            type="text"
                            class="multidate-picker form-control align-left input-small"
                            autocomplete="off"
                            data-datepicker />
                            <input
                                type="hidden"
                                id="<?= $this->getId('input') ?>"
                                var_dump($dates);exit;
                                name="<?= $name ?>[date][]"                                 
                                value="<?= $value['date'][$i] ?>"
                                data-datetime-value
                                />
                        <?php if ($this->mode != 'date'): ?>
                        <input
                            type="text"
                            id="<?= $this->getId('input') ?>-sttime"
                            name="<?= $name ?>[sttime][]"
                            value="<?= $value['sttime'][$i] ?>"
                            class="form-control align-left timepicker"/>

                        <input
                            type="text"
                            id="<?= $this->getId('input') ?>-entime"
                            name="<?= $name ?>[entime][]"
                            value="<?= $value['entime'][$i] ?>"
                            class="form-control align-left timepicker"/>
                        <?php endif ?>
                        <a href="nojavascript...void(0);" onClick="$(this).parent().remove();"><i class="icon-trash-o"></i></a>
                    </div>
                </div>
                <?php } ?>
                <?php $i++; ?>
        <?php } ?>
    <?php } ?>
</div>
<script type="text/javascript">
$(document).ready(function(){
    $('.timepicker').timepicker({
        timeFormat: "<?= $PE_DATE_TIME ?>"
    });
    $( ".multidates_dates").each(function(){
            $(this).find(".icon-trash-o" ).first().hide();
    });
    $('.add_date_<?= $id  ?>').click(function(e){
        var temp = $( ".multidate-input_<?= $id  ?>").first().clone();
        temp.find('.multidate-picker').val('');
        temp.find('.icon-trash-o').show();
        $('#multidate_dates_<?= $id  ?>').append(temp);

        $('.timepicker').timepicker({
            timeFormat: "<?= $PE_DATE_TIME ?>"
        });
        $('[data-control="datepicker"]').each(function(){ $(this).datePicker({ format: "<?= $PE_DATE_BACKEND ?>" }); });
        return false;
    });
});
$('[data-control="datepicker"]').each(function(){ $(this).datePicker({ format: "<?= $PE_DATE_BACKEND ?>" }); });
</script>

<?php endif ?>

dhuunghia6211
dhuunghia6211

ChadStrat said:

also, I gave you the wrong file path, it should be:

/plugins/radiantweb/proevents/modules/backend/formwidgets/Multidate.php

The address has not changed, but it was installed after the purchase.

ChadStrat
ChadStrat

please carefully make sure you are adding 'var_dump($dates);exit;' to line 64 of /plugins/radiantweb/proevents/modules/backend/formwidgets/Multidate.php - double check you are adding the var_dump to the correct file correct line of code.

dhuunghia6211
dhuunghia6211

ChadStrat said:

please carefully make sure you are adding 'var_dump($dates);exit;' to line 64 of /plugins/radiantweb/proevents/modules/backend/formwidgets/Multidate.php - double check you are adding the var_dump to the correct file correct line of code.

Sorry for not being attentive!

https://i.vgy.me/c2IcCL.png

dhuunghia6211
dhuunghia6211

The previous question didn't have an answer, so I went back to the old version of PHP. And everything works as usual.

Now testing October v.2 for an update, and again an error has occurred:

We're sorry, but an unhandled error occurred. Please see the details below.

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'octoberdb.radiantweb_generated_dates.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (SQL: select * from radiantweb_generated_dates where event_date >= 2021-05-15 group by grouped_id, event_id order by event_date asc, sttime asc limit 10 offset 0) ~/vendor/laravel/framework/src/Illuminate/Database/Connection.php line 669

dhuunghia6211
dhuunghia6211

Issue has been resolved by change the 'strict' value to false in the database configuration in config/database.php.

'connections' => [ ...

'mysql' => [
...
    'strict' => false,
    ...

],

]

Also, If you see an error like this: ... Please provide a valid cache path... You need to create a folder views in storage/framework

dhuunghia6211
dhuunghia6211

The "Add more" button does not work in October CMS V.2: (Function to create and change work as usual)

https://i.vgy.me/xNZZMC.png

daftspunk
daftspunk

dhuunghia6211 said:

The "Add more" button does not work in October CMS V.2: (Function to create and change work as usual)

Do you see any errors in the JS console?

dhuunghia6211
dhuunghia6211

Errors in the JS console:

Failed to launch 'javascipt:void(0);' because the scheme does not have a registered handler.

daftspunk
daftspunk

Hmm, looks like a typo -- javascipt:void should be javascript:void

feym
feym

Hello!

I'm having the exact same issue, with $value in _multidate.htm.

Trying to access array offset on value of type null ~\plugins\radiantweb\proevents\modules\backend\formwidgets\multidate\partials_multidate.htm line 24

Tried everything as mentioned above. var_dump($value); outputs what I excpect, an array filled with dates.

I'm using laragon 5.0.0 and tried PHP v7.4.19 and v8.0.9. I'm devleoping on my local machine.Any ideas on how to solve this?

1-20 of 27