WebDevStudios / CMB2-Date-Range-Field

20 stars 9 forks source link

Undefined index: desc - error in log #10

Open jajouka79 opened 8 years ago

jajouka79 commented 8 years ago

PHP Notice: Undefined index: desc in /home/sbeasley/Sites/stt/web/app/plugins/CMB2-Date-Range-Field/wds-cmb2-date-range-field.php on line 136

i am getting this error, any ideas what it could be?

thanks

jajouka79 commented 8 years ago

actually its line 132

tw2113 commented 8 years ago

Out of curiosity, with your use for the field type, are you providing a desc parameter? May not be properly filling in a default for those who don't, as is.

That said, shouldn't be a breaking issue for the site.

Ipstenu commented 8 years ago

I had the exact same error testing on DesktopServer, and it was a breaking issue.

The value for $a isn't being passed through. I spent some time messing with it, and it's related to parse_args. I didn't dig further, since it turned out not to be what I needed (I need a year range only, with options spanning 1930 to 'current'), but it's totally messed up on Server Press :(

jtsternberg commented 8 years ago

Can either of you test after this change?

rasmustaarnby commented 7 years ago

@jtsternberg I have tested this with CMB2 2.2.2 and 2.2.2.1 and your latest commit fixes this issue. However, I now get the following notice:

Notice: Array to string conversion in /wp-content/plugins/cmb2/includes/types/CMB2_Type_Base.php on line 103

which seems to be related to the empty array passed as the first param in the parse_args here https://github.com/WebDevStudios/CMB2-Date-Range-Field/blob/master/wds-cmb2-date-range-field.php#L123

That array is directly passed thorough and used in the filter here which causes that issue: https://github.com/WebDevStudios/CMB2/blob/trunk/includes/types/CMB2_Type_Base.php#L103

Changing the param order seems to fix this. I have sent a pull request.