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

Edit all crashes if you edit pageTree fields or add a link in TinyMCE #1130

Closed
bezin opened this issue Oct 6, 2017 · 4 comments
Closed

Edit all crashes if you edit pageTree fields or add a link in TinyMCE #1130

bezin opened this issue Oct 6, 2017 · 4 comments
Assignees
Labels
Milestone

Comments

@bezin
Copy link
Contributor

bezin commented Oct 6, 2017

Hello there,

the Edit All functionality fails under specific circumstances.

To reproduce, do the following in the online demo:

  1. Edit article "Home"
  2. Edit all > select both content elements > Select field "text"
  3. Select some text and format it as bold with the toolbar button
  4. Save > Everything works fine
  5. Select some text and mark it up as link with the toolbar button
  6. Select any page with the page picker
  7. Save > You will get the following output and an otherwise blank page:
Warning: implode(): Invalid arguments passed in /home/www/releases/12/vendor/contao/core-bundle/src/Resources/contao/classes/DataContainer.php on line 342

Warning: implode(): Invalid arguments passed in /home/www/releases/12/vendor/contao/core-bundle/src/Resources/contao/classes/DataContainer.php on line 342

Warning: implode(): Invalid arguments passed in /home/www/releases/12/vendor/contao/core-bundle/src/Resources/contao/classes/DataContainer.php on line 342

Warning: implode(): Invalid arguments passed in /home/www/releases/12/vendor/contao/core-bundle/src/Resources/contao/classes/DataContainer.php on line 342

Warning: implode(): Invalid arguments passed in /home/www/releases/12/vendor/contao/core-bundle/src/Resources/contao/classes/DataContainer.php on line 342

This also happens, if you multi edit a field of input type pageTree.

In an local Contao 4.4.5 installation: The $key = "FORM_FIELDS_40", that causes the warning in this setting, is a content element in a different article, on a different page, on a different root page. Anyhow, I did not figure out where this field ID is coming from.

contao_edit_all

If you need any more information, I willll try to provide them :)

Cheers

@bezin
Copy link
Contributor Author

bezin commented Oct 9, 2017

This is the call stack btw.

( ! ) Warning: implode(): Invalid arguments passed in C:\development\web\vhosts\[...]\vendor\contao\core-bundle\src\Resources\contao\classes\DataContainer.php on line 342
--
1 | 0.0012 | 146384 | {main}( ) | ..\app.php:0
2 | 0.0514 | 2882856 | Symfony\Component\HttpKernel\HttpCache\HttpCache->handle( ) | ..\app.php:24
3 | 0.0527 | 2905840 | Symfony\Component\HttpKernel\HttpCache\HttpCache->invalidate( ) | ..\HttpCache.php:182
4 | 0.0527 | 2905864 | Symfony\Component\HttpKernel\HttpCache\HttpCache->pass( ) | ..\HttpCache.php:256
5 | 0.0528 | 2906080 | Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward( ) | ..\HttpCache.php:239
6 | 0.0811 | 4776920 | Symfony\Component\HttpKernel\HttpCache\HttpCache->forward( ) | ..\HttpCache.php:59
7 | 0.0813 | 4777688 | Symfony\Component\HttpKernel\Kernel->handle( ) | ..\HttpCache.php:467
8 | 0.0986 | 5499544 | Symfony\Component\HttpKernel\HttpKernel->handle( ) | ..\Kernel.php:171
9 | 0.0986 | 5500168 | Symfony\Component\HttpKernel\HttpKernel->handleRaw( ) | ..\HttpKernel.php:68
10 | 0.4412 | 12684120 | call_user_func_array:{C:\development\web\vhosts\[...]\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php:153} ( ) | ..\HttpKernel.php:153
11 | 0.4412 | 12684264 | Contao\CoreBundle\Controller\BackendController->mainAction( ) | ..\HttpKernel.php:153
12 | 0.6420 | 13632672 | Contao\BackendMain->run( ) | ..\BackendController.php:55
13 | 0.6451 | 13816408 | Contao\Backend->getBackendModule( ) | ..\BackendMain.php:131
14 | 0.9215 | 18975528 | Contao\DC_Table->editAll( ) | ..\Backend.php:629
15 | 0.9522 | 19283856 | Contao\DataContainer->row( ) | ..\DC_Table.php:2495
16 | 0.9556 | 19576224 | implode ( ) | ..\DataContainer.php:342

@leofeyer
Copy link
Member

This is because $session['CURRENT']['IDS'] is overwritten as soon as you open the picker (which calls the showAll() method).

$session['CURRENT']['IDS'] = $this->current;

@contao/developers IMO this is a left-over from the older days where Contao did not have checkboxes to select the records to edit in "edit multiple" mode. The IDs are actually set in line 147 now.

$session['CURRENT']['IDS'] = $ids;

I would therefore remove line 357 to 360. Any objections?

@leofeyer leofeyer added the bug label Oct 13, 2017
@leofeyer leofeyer added this to the 4.4.8 milestone Oct 13, 2017
@Toflar
Copy link
Member

Toflar commented Oct 14, 2017

Sounds okay to me.

@leofeyer leofeyer self-assigned this Nov 9, 2017
@leofeyer
Copy link
Member

leofeyer commented Nov 9, 2017

Fixed in 596f029.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants