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

Umzug von Urwahl3000 - Termine werden nicht vollständig importiert #498

Closed
weissgruenbunt opened this issue Feb 9, 2024 · 1 comment · Fixed by #501
Closed

Umzug von Urwahl3000 - Termine werden nicht vollständig importiert #498

weissgruenbunt opened this issue Feb 9, 2024 · 1 comment · Fixed by #501

Comments

@weissgruenbunt
Copy link
Contributor

Hi,
die Termine werden bei der Umstellung von Urwahl3000 auf sunflower nicht korrekt migriert:

  1. WP_Query ist abhängig von Nutzereingabe (Wordpress -> Einstellungen -> Lesen -> Blogseiten zeigen maximal). Bei den Standardeinstellungen (=10) werden auf diese Weise nur die letzten 10 Termine migriert.
    Mögliche Lösung: Parameter hinzufügen (Alle = -1 oder einstellbar machen über das Theme mit absolutem Wert, Zeitraum o.Ä.).
// activation.php
...
function sunflower_import_events() {
	$events = new WP_Query(
		array(
			'post_type' => 'termine',
			'posts_per_page' => '-1', // BEISPIEL FÜR ALLE
		)
	);
...
  1. Das jeweilige Beitragsbild der Termine wird nicht migriert (meta-Wert _thumbnail_id).
    Mögliche Lösung: Checken ob Beitragsbild vorhanden und ggf. hinzufügen.
// activation.php
...
function sunflower_import_events() {
	...
        foreach ( $events->posts as $post ) {
                ...
                if($meta['_thumbnail_id'][0]) {
			update_post_meta( $id, '_thumbnail_id', $meta['_thumbnail_id'][0] );
		}
                ...
        ...
...

Ich hoffe, dass ich mich verständlich ausgedrückt habe :)

@albig
Copy link
Member

albig commented Feb 12, 2024

Danke @weissgruenbunt. Klingt plausibel. Ich hab das Feature noch nie ausprobiert und muss mir mal einen passenden Anwendungsfall suchen.
Ist dein Vorschlag in 2. schon ausreichend? Du kannst natürlich auch einen Pull-Request stellen, wenn Du das eh schon fertig rumliegen hast.

albig added a commit that referenced this issue Feb 13, 2024
albig added a commit that referenced this issue Feb 13, 2024
Fix #498: import all events from urwahl3000 including thumbnails
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

Successfully merging a pull request may close this issue.

2 participants