soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
314 stars 29 forks source link

Fatal Error at Sitemapcreation with Rankmath #3477

Open mark88008 opened 10 months ago

mark88008 commented 10 months ago

its a fatal memory error because of the compatibility code to include images, added at file wp-content/plugins/oxygen/component-framework/admin/admin.php

I have this issue, when I want to view the sitemap of pages, where I have few repeater per page, containing images. It crashes the sitemap-page and only when I make the sitemap containing one page, instead of all 20 pages, it's working somehow.

RankMath sent me a code, which I need to insert after any update of their plugin, so that the sitemap doesnt crash.

I am using on the pages repeater, which are automatically queried from ACF selections on each different page.

The code is this for one of the repeater:

CODE BEFORE REPEATER:

<?php
function pre_get_posts_feedback_check_acf_cat ($query) {
// check if ACF is active
if (!function_exists('get_field')) return;
// get field (once!)
$seitenkategorie = get_field('seiten_kategorie');
$kategorie_feedback = null;
switch($seitenkategorie) {
case 'seminare': {$kategorie_feedback = 'seminare'; break;}
case 'startseite': {$kategorie_feedback = 'startseite'; break;}
case 'fuehrungskraefte': {$kategorie_feedback = 'fuehrungskraefte'; break;}
case 'coaching': {$kategorie_feedback = 'coachings'; break; }
case 'mitarbeiter': {$kategorie_feedback = 'mitarbeiter'; break; }
case 'redner': {$kategorie_feedback = 'redner'; break; }
case 'trainerausbildung': {$kategorie_feedback = 'trainer'; break; }
case 'unternehmer': {$kategorie_feedback = 'unternehmer'; break; }
case 'verkaeufer': {$kategorie_feedback = 'verkaeufer'; break; }
case 'vortraege': {$kategorie_feedback = 'vortraege'; break; }
}
if ($kategorie_feedback) {
$query->set('post_type', 'feedback');
$query->set('kategorie-feedback', $kategorie_feedback);
}
}
add_action('pre_get_posts', 'pre_get_posts_feedback_check_acf_cat');
?>

Repeater


CODE AFTER REPEATER:

<?php
remove_action('pre_get_posts', 'pre_get_posts_feedback_check_acf_cat');
?>

It was done like this, because I wanted to make it for the workflow as effective as possible. So there is just one Template for example the video-swiper and it gets the videos just from the category which fits to the pages, where the template is placed in.

But somehow this creates some problem I guess.

mark88008 commented 10 months ago

Is there anybody looking at this issue?

Kpudlo commented 10 months ago

Hi Mark,

Please try and recreate the issue on a Sandbox site (https://oxygenbuilder.com/try/). Then, send a link to the Sandbox site as well as the minimal steps necessary to recreate the issue. After we have that information, we'll be able to review the issue further.

If you can't recreate the issue on a Sandbox site, please open a Support Ticket (https://oxygenbuilder.com/support), and provide a staging environment where we can see the problem. We'll be glad to assist further. If you can also include a link to this discussion in that ticket, that would be appreciated.

mark88008 commented 10 months ago

i have here the sitemap link for you from the staging website. https://dev1.m-create.at/page-sitemap.xml

Here ist the archive of the sitemaps: https://dev1.m-create.at/sitemap_index.xml

Its concerning just the pages, because just there I was using the query written above.

If I make a change in the sitemap to just view one page per sitemap, then I have no error. But already with 2 pages in a sitemap, I am getting the error.

It comes from too less memory. RankMath told me then to increase the memory to 1000mb but also this doesn't really help.

Kpudlo commented 9 months ago

Hello,

If you still need help with this, please open a Support Ticket (https://oxygenbuilder.com/support), and provide a staging environment where we can see the problem. We'll be glad to assist further. If you can also include a link to this discussion in that ticket, that would be appreciated.