Dynamic collection index/details - Forum | JoomShaper
Solved SP Page Builder

Dynamic collection index/details

Asked by TPMH Tiszaújváros 7 months ago Last activity 6 months ago

Hello

I ran into a problem while using dynamic collection. I don't know if I'm doing something wrong.
I created a collection with 3 fields: text, option, rich text.
I uploaded the records, published them, access public.
I created a dynamic_index page with 1 field.
I created a dynamic_details page with 2 fields.

On the index page, link-->page is the dynamic_details page.
On the page, the first record appears on the detailed page, from the second record, an error message randomly appears:
At this time, the screen is blank.

Am I doing something wrong?
Latest SP version.

BR
Csaba

Accepted answer

Marked as the solution
Ziaul Kabir Staff

It’s great to hear that your issue has been resolved.
If everything is working fine now, please mark the question as complete by accepting any of our answers.

Thank you!

7 more replies

Ziaul Kabir Staff

Hello,

Thanks for reaching out to us. Could you please share temporary administrator access to your Joomla backend? You can provide the credentials securely in the hidden content section. Also, please take a full backup of your site before we make any changes.

Once I have access, I’ll investigate further and see what’s causing the issue. Let me know once you’ve shared the details!

Best regards,

TPMH Tiszaújváros Asked this

Hi!

Sorry for the late reply.

The site is running on a developer machine, there is no internet access.

I was able to fix the error by deleting the records that were not appearing and then re-uploading them, so the error went away.

Br
Csaba

Ziaul Kabir Staff

It’s great to hear that your issue has been resolved.
If everything is working fine now, please mark the question as complete by accepting any of our answers.

Thank you!

TPMH Tiszaújváros Asked this

Hi!

Unfortunately my joy was premature :)
It started randomly again.
I will upload it to one of our servers and send you login details soon.

Br
Csaba

Ziaul Kabir Staff

Sure.

Thanks

TPMH Tiszaújváros Asked this

Hi

I will send you the access.

BR
Csaba

Ziaul Kabir Staff

Please, check now. I have linked them with details page.

Thanks

TPMH Tiszaújváros Asked this

Hi!

It doesn't work, it just gives a blank page.
Try multiple lines.

Br
Csaba

Ziaul Kabir Staff

Could you please share an Akeeba ZIP backup file with me?

I will check the issue on my end.

Best regards,

TPMH Tiszaújváros Asked this

Hi!

We do not use Akeeba software, but I am attaching the link to the root directory rar file and the sql backup file.

Br
Csaba

Ziaul Kabir Staff

Hello,

I tried running your site on my local end, but it seems there are some issues with plugins. Please make sure the following plugins are enabled: https://prnt.sc/1DT31UxoIukp. Also, ensure that the JCE Pro plugins are working correctly.

Thanks.

TPMH Tiszaújváros Asked this

Hi

Behaviour - Backward Compatibility 6 - enabled
JCE Pro - no problem, latest version. JCE is working fine.
The error still exists.

What I found:
Warning: foreach() argument must be of type array|object, null given in E:\www\developer\administrator\components\com_sppagebuilder\dynamic-content\Site\PageSeoSettings.php on line 213

This warning only appears on a blank page, in the event of an error.

Br
Csaba

TPMH Tiszaújváros Asked this

Hi
for example:

$data = (new CollectionDataService())->fetchCollectionItemById($itemId);

administrator\components\com_sppagebuilder\dynamic-content\Site\PageSeoSettings.php
line 209:
ItemId on-screen: 2950
In databes: 40

Database max iteimd number: 138 :)
Br
Csaba

Ziaul Kabir Staff

But on my end, I can not restore this.

Thanks

TPMH Tiszaújváros Asked this

Hi!

For some reason the following:

$input = Factory::getApplication()->input;

does not contain the itemid correctly:

[Itemid] => 147 [collection_item_id] => Array ( [0] => 2950 )

Br Csaba

Ziaul Kabir Staff

Hi Csaba,

Thank you for checking this.

It seems that the request is passing collection_item_id = 2950, but this ID does not exist in the database (the maximum item ID is 138). Because of this, the function fetchCollectionItemById($itemId) returns null, which then triggers the foreach() warning in PageSeoSettings.php.

Most likely this is happening due to an invalid or outdated collection_item_id parameter being passed in the request. Could you please check if any page, dynamic content, or menu item is referencing collection item 2950?

You may also want to clear the Joomla cache and verify the SP Page Builder collection settings.

Please let me know if you find where this ID is coming from.

Thanks.

TPMH Tiszaújváros Asked this

I found it!

Originally, the data stored in DC was in separate Joomla articles, whose categories had menu items assigned to them. I deleted the old articles, categories and their menu items and the error disappeared.

Thanks for your help!
BR
Csaba

Log in to reply.