Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fehler in Kalendercode #91

Open
k3x opened this issue Jan 20, 2021 · 2 comments
Open

Fehler in Kalendercode #91

k3x opened this issue Jan 20, 2021 · 2 comments

Comments

@k3x
Copy link

k3x commented Jan 20, 2021

Ich erhalte in unregelmäßigen Abstand folgenden Fehler per Mail:

Ein Fehler vom Typ E_ERROR wurde in der Zeile 234 der Datei /[...]/wordpress/wp-content/themes/urwahl3000/functions/kal3000/kal3000.php verursacht. Fehlermeldung: Uncaught Error: Call to a member function format() on bool in /[...]/wordpress/wp-content/themes/urwahl3000/functions/kal3000/kal3000.php:234
Stack trace:
#0 /[...]/wordpress/wp-content/themes/urwahl3000/functions/kal3000/kal3000.php(344): kal3000_the_termin()
#1 /[...]/wordpress/wp-includes/class-wp-hook.php(287): kal3000_add_content('')
#2 /[...]/wordpress/wp-includes/plugin.php(212): WP_Hook->apply_filters('', Array)
#3 /[...]/wordpress/wp-includes/formatting.php(3822): apply_filters('the_content', '')
#4 /[...]/wordpress/wp-includes/class-wp-hook.php(287): wp_trim_excerpt('', Object(WP_Post))
#5 /[...]/wordpress/wp-includes/plugin.php(212): WP_Hook->apply_filters('', Array)
#6 /[...]/wordpress/wp-includes/post-template.php(429): apply_filters('get_the_excerpt', '', Object(WP_Post))
#7 /[...]
@k3x
Copy link
Author

k3x commented Jan 28, 2021

push

@k3x
Copy link
Author

k3x commented Feb 2, 2021

Ich glaube der Fehler tritt auf, wenn Datum/Uhrzeit nicht ausgefüllt sind. Ich habe die Benutzer angewiesen das immer auszufüllen. Zusätzlich habe ich den Teil aber entsprechend angepasst:

    $wpcal_from_u = new DateTime('2000-01-01T00:00:00.00000Z');

    if($meta_angabe_zeit['_wpcal_from'][0]!=="") {
        $wpcal_from = date_create_from_format( 'd.m.Y H:i', $meta_angabe_zeit['_wpcal_from'][0] );
        if($wpcal_from !== false) {
            $wpcal_from_u = get_date_from_gmt( $wpcal_from->format('Y-m-d H:i:s'), 'U' );
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant