Problems, need help? Have a tip or advice? Post it here.
33 posts Page 4 of 4
@varunaravind,
I tested your code and could add the template without any problem.
So, nothing wrong with the code.

Please try the tip given earlier in this thread (viewtopic.php?f=4&t=8059#p13845) to make sure you are accessing the modified template as super-admin (without which the changes won't get persisted).
Live-Server:
CouchCMS 1.4.7
php 5.6

Local-Server:
Windows 10
XAMPP 64x-8.0.28 (otherwise the the project doesn't work)
CouchCMS 2.3 (20220107) (accounting for curly braces issue)

ERROR: Enddatum: Validator 'myevent::start_date' not found


Hello,

I am having an issue with an old template. In this template there is a validator. This validator causes the inability to create new exhibitions specifically on the local server. The live server works fine. So I assume that this is either a Couch or a php issue?
I can't find any reference to MyEvent anywhere in the code except in kfunctions.php which I think was added very recently or was modified by someone who now does not work on it anymore and the project has been (seemingly) downloaded completely from the live server.

If I remove the validator the front-end doesn't display the list of assigned images anymore.

Code: Select all
<cms:template title='Wuppertal - Austellungen' clonable='1' order='3'>

    <cms:editable type='relation' name='exhibition_artist' masterpage='artists.php' label='Künstler' order='1' />

    <cms:editable
        name='start_date'
        label='Enddatum'
        type='datetime'
        format='dmy'
        fields_separator=','
        default_time='@current'
        required='0'
        validator='MyEvent::start_date'
        validator_msg='myevent::start_date=Incorrect date format'
        width='155'
                  order='5'
    />

    <cms:editable
        name='real_start_date'
        label='Startdatum'
        type='datetime'
        format='dmy'
        fields_separator=','
        default_time='@current'
        required='0'
        width='155'
                  order='2'                 
    />
   
   
   
        <cms:editable
        name='start_time_hour'
        label='Startzeit Stunde'

        opt_values=' 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24'
        opt_selected='19'
        type='dropdown'

        required='0'
        width='155'
        order='3'                 
    />
   
        <cms:editable
        name='start_time_minute'
        label='Startzeit Minute'

        opt_values=' 00 | 05 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 '
        opt_selected='00'
        type='dropdown'

        required='0'
        width='155'
        order='3'                 
    />
       
  <cms:editable type='richtext' name='exhibition_text_deu' label='Text (deutsch)' desc='' order='6' />
  <cms:editable type='richtext' name='exhibition_text_eng' label='Text (englisch)' desc='' order='7' />

    <cms:repeatable name='exhibition_imgs' order='8' >
Hi,

The issue, as can be seen reported, is that Couch cannot find a custom validator (which in this case is a method named 'start_date' within a class named 'MyEvent').

This class (and hence the missing method) has likely been placed in a kfunctions.php file -
most probably it would be the one found in 'couch/addons' folder but one can also be placed in the site's root.

Please search for this file in your live server and then find the mentioned class::method.
Use that in your local installation and the error should disappear.

Hope this helps.
33 posts Page 4 of 4
cron