Too many values of repeater give max execution error when saving

131 Views Asked by At

I am working on a project in octoberCMS(learner/beginner) where i have a tab with a repeater having around 100 values. So whenever i try to save the product i get maximum execution time.

I know it can fixed by increasing the max execution time but i'm looking for permanent fix and not a hack where I don't have to change system configs. I tried to implement Pagination. It took about a whole day to implement pagination and later I figured it saves the values as json and will only save the part of the active pagination page. So I'm looking for suggestions that can be implemented without any hacks and feels right. Please check the attachment.

enter image description here

Is there anyway we can display just the repeater in different url linking with the same product?

1

There are 1 best solutions below

1
On BEST ANSWER

You could create a custom page that only had the repeater fields on it, but eventually you still are going to hit your maximum execution time on that page as well. I doubt it'll drop the amount of processing enough for it to make much of a difference on how many repeater fields you can add.

I'm not sure why you think increasing max execution time is a hack- it is a totally valid way to allow longer running processes to finish. It appears you are using MAMP on your local machine based on the screenshot, your local machine might not be the best gauge for how your application will perform on a real web server.

All that being said though- 90 fields is a lot for a repeater, it typically is used in cases where you don't have a ton of data and you want to keep it tied to the database record. For the amount of records you're describing, I think a much better solution that "feels right" would be to use relationships.

Probably you want a One to Many relationship. I would read through that section and then read through Backend Relations. This will give you pagination, the ability to search, easier access to the data from the code, etc. all for free and is usually a better solution than repeaters.

Hope that helps.