Forum

Thread tagged as: Problem

Blocks with repeater losing data

I have blocks with repeaters inside. 23 blocks with 123 repeater items. The use case is a menu for a restaurant. Each block is a section and each section contains menu items.

Near the end, the last three block sections do not retain data entered into the repeaters when saving. The last block to retain data holds one repeater item and adding more does not stay after saving.

Page debug output is clear. Diagnostic is here. Wondering if the database field gets filled up with HTML.

Perch: 2.8.32, PHP: 5.6.10, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32)
App runtimes: <?php $apps_list = array( 'content', 'categories', );
PERCH_LOGINPATH: /fs/perch
PERCH_PATH: /Applications/MAMP/htdocs/fs/perch
PERCH_CORE: /Applications/MAMP/htdocs/fs/perch/core
PERCH_RESFILEPATH: /Applications/MAMP/htdocs/fs/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: localhost:8888
DOCUMENT_ROOT: /Applications/MAMP/htdocs
REQUEST_URI: /fs/perch/core/settings/diagnostics/
Fred Stidston

Fred Stidston 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Sounds like you are hitting a max_input_vars restriction https://php.net/manual/en/info.configuration.php

I would suggest using a regular Repeated Region for the top level here rather than Blocks. This doesn't sound like a good use case for Blocks.

Thank you

One question though - if repeaters cannot be nested then how will I create the section > item structure within a Perch template?

Simon Clay

Simon Clay 127 points

Could you use a multi-item region as the 'section' to take the strain off the blocks?

The solution is adding the line below to my php.ini file

max_input_vars = 2000
Drew McLellan

Drew McLellan 2638 points
Perch Support

Right - it's a PHP 'security' limit. (A stupid one if you ask me.)