Forums

CF5 Events event.php index value undefined

NickOg 18 Apr, 2015
Hi

The form was working fine but now the page load logic seems to have gone awry! In looking for the problem I find this in the Designer Events tab.

[attachment=0]eventBug.jpg[/attachment]

No idea what has caused that, I will try back & restore or worst case, reconstruct the form.

Any suggestions as to cause?

Regards

Nick
GreyHead 19 Apr, 2015
Answer
Hi Nick,

I think I found the problem and have a fix if not a solution.

I was able to replicate this in Joomla! 3.4.1 with a form where I had a container with no name. Adding a space ' ' as a name seemed to remove the errors.

In the code I was able to edit /administrator/components/com_chronoforms5/chronoforms/events/event.php around line 20 (see below) this also removed the error but the draggable labels in the left hand column are slightly misplaced (though they still seem to work).

Bob

					if($field['type'] != 'multi'){
						/*$label = !empty($field['label']['text']) ? $field['label']['text'] : (!empty($field['label']) ? $field['label'] : $field['value']);*/
						if ( !empty($field['label']['text']) ) {
							$label = $field['label']['text'];
						} elseif ( !empty($field['label']) ) {
							$label =  $field['label'];
						} elseif ( !empty($field['value']) ) { // I added this extra check 
							$label = $field['value'];
						} else {
							$label = ''; // and this default label if there is no label or value set
						}
NickOg 19 Apr, 2015
Hi Bob

Thanks for that. I will check that out on Tuesday. My rebuild avoided it though it did hit me once more.

Nick
GreyHead 19 Apr, 2015
Hi Nick,

Max told me that he had already worked a fix for it so that should be in the next release version.

Bob
NickOg 19 Apr, 2015
Thanks again Bob. I was able to reproduce the problem. Removing a container label causes the problem. Putting it back solves it. I will wait for Max's next release now I at least now how to avoid it.

Nick
This topic is locked and no more replies can be posted.