Project

General

Profile

Actions

Bug #43504

closed

Flexform internal_type=folder doesn't work and breaks Element Browser

Added by Manuel Soehner over 11 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Must have
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2012-12-01
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

My slideshow extension uses a flexform (for plugin configuration in the backend) with following snippet:

<folder>
 <TCEforms>
  <label>Folder with images to display</label>
  <config>
   <type>group</type>
   <internal_type>folder</internal_type>
   <maxitems>1</maxitems>
   <size>1</size>
  </config>
 </TCEforms>
</folder>

This causes several problems, depending on the user's state or something like that.

Normally I see the following exception when opening the element browser:

#1: PHP Catchable Fatal Error: Argument 1 passed to TYPO3\CMS\Recordlist\Browser\ElementBrowser::TBE_expandSubFolders() must be an instance of TYPO3\CMS\Core\Resource\Folder, null given, called in /../typo3_src-6.0.0/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php on line 1252 and defined in /.../typo3_src-6.0.0/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php line 1427

My test user (no admin) also runs into this message but when I managed to open the element browser somewhere else in the backend and have expanded a folder, the element browser opens as expected.
Unfortunately, after clicking on the folder name, the element browser closes and nothing is selected (the expected value would have been the path to the folder).

After that, the syslog contains these error messages (ordered by descending timestamp):

Core: Error handler (BE): PHP Warning: basename() expects parameter 1 to be string, object given in /.../typo3_src-6.0.0/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php line 1673 

Core: Error handler (BE): PHP Warning: rawurlencode() expects parameter 1 to be string, object given in /.../typo3_src-6.0.0/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php line 1666 

Core: Error handler (BE): PHP Warning: strstr() expects parameter 1 to be string, object given in /.../typo3_src-6.0.0/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php line 1660 

Core: Error handler (BE): PHP Warning: Missing argument 2 for TYPO3\CMS\Recordlist\Browser\ElementBrowser::folderList(), called in /.../typo3_src-6.0.0/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php on line 1430 and defined in /.../typo3_src-6.0.0/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php line 1653 

Core: Error handler (BE): PHP Warning: rtrim() expects parameter 1 to be string, object given in /.../typo3_src-6.0.0/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php line 1867

If I change the "internal_type" to "file", everything works fine - but I'd like to select a folder.

I noticed this behavior after updating from version 4.7.7 to 6.0.0 in my production system.
In order to reproduce the error I set up a clean TYPO3 (blank package) and only installed my extension.


Files


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #63651: Group type 'Folder' broken for TCAClosed2014-12-08

Actions
Has duplicate TYPO3 Core - Bug #54299: Flexform - type group, folder - Uncaught TYPO3 ExceptionClosed2013-12-10

Actions
Precedes TYPO3 Core - Bug #55619: Replace folderList implementation in ElementBrowserClosed2014-02-03

Actions
Actions #1

Updated by Noel Bossart about 11 years ago

I have the same Issue. 'internal_type' => 'file', works, 'folder' breaks.

'folder' => array(
'exclude' => 1,
'label' => 'LLL:EXT:nbogallery/Resources/Private/Language/locallang_db.xml:tx_nbogallery_domain_model_gallery.folder',
'config' => array(
'type' => 'group',
'internal_type' => 'folder',
'show_thumbs' => '1',
'size' => '3',
'maxitems' => '200',
'minitems' => '0',
'autoSizeMax' => 40,
'disable_controls' => 'upload',
),
),
Actions #2

Updated by Stefan Galinski about 11 years ago

  • Category set to File Abstraction Layer (FAL)
  • Status changed from New to Accepted
Actions #3

Updated by Ina Beckmann almost 11 years ago

Problem still exists in TYPO3 6.1 (found it in ke_search file indexer).

PHP Catchable Fatal Error: Argument 1 passed to TYPO3\CMS\Recordlist\Browser\ElementBrowser::TBE_expandSubFolders() must be an instance of TYPO3\CMS\Core\Resource\Folder, null given, called in /html/typo3/typo3_src-6.1.0/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php on line 1278 and defined in /html/typo3/typo3_src-6.1.0/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php line 1453
Actions #4

Updated by Matthias Toscanelli over 10 years ago

Problem comes when no folder is given. (usually when a plugin or a record is initialized)

One solution would be to set the "selectedFolder" in user's default upload folder by default when no folder is given as it's done with "file".

Adding this at line 1269 in typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php solve the problem:

// Or get the user's default upload folder
if (!$this->selectedFolder) {
    $this->selectedFolder = $GLOBALS['BE_USER']->getDefaultUploadFolder();
}
Actions #5

Updated by Matthias Toscanelli over 10 years ago

Well my solution solved only the exception.

The main problem is that function "folderList" has not been revritten.
I did a patch to correct the exception and rewrite the "folderList" function.

TYPO3 version 6.0 to 6.2 need this patch.

Updated by Benjamin Schmidt over 10 years ago

Thanks Matthias for your patch. Finally there is a solution for this bug :)

Sadly I couldn't directly apply your patch to my typo3 6.0.6, so I had to do it manually :/
My patchfile and the updated ElementBrowser.php v6.0.6 is attached.

Actions #7

Updated by Jürgen König over 10 years ago

Still got the error in 6.1.4 and ke-search. Your Patch solves the problem. Thanks Matthias and Benjamin!

Actions #8

Updated by Marcos Fadul over 10 years ago

Patch applies successfully on Typo3 6.1.5 and solves the issue. Thank you Matthias and Benjamin!
Regards

Actions #9

Updated by Eric Chavaillaz over 10 years ago

I got the same problem with TYPO3 6.1.5.
Can someone send a patch to gerrit and then the review process can begin?

Actions #10

Updated by Eric Chavaillaz over 10 years ago

The same in TYPO3 6.2...

Actions #11

Updated by Alexander Opitz over 10 years ago

  • Assignee set to Alexander Opitz
  • Is Regression set to No

Is there an extension on typo3.org which have this issue?

Actions #12

Updated by Eric Chavaillaz over 10 years ago

I don't know, personnaly I use it in a custom extension...

Thanks

Actions #13

Updated by Manuel Soehner over 10 years ago

I also don't know if there's an extension on typo3.org that uses that feature but I've created a simple demo extension (see attached t3x) that works fine on TYPO3 4.7.* but fails on TYPO3 6.*

Just install the extension, create a page content of type "plugin", choose that plugin and in the "Plugin Options" open the Element Browser and select a folder.

Actions #14

Updated by Christian Buelter over 10 years ago

ke_search uses this feature.

Error is still there with current master of TYPO3 CMS.

Test case:

  • Install TYPO3 CMS blank package
  • Install ke_search
  • [with ke_search 1.5] set compatibilty version to 6.2.99 in ext_emconf.php
  • Create a sysfolder
  • Create a record of type "indexer configuration", set the type to "file"
  • In the field "Directories" try to select a directory

Error message:

PHP Catchable Fatal Error: Argument 1 passed to TYPO3\CMS\Recordlist\Browser\ElementBrowser::TBE_expandSubFolders() must be an instance of TYPO3\CMS\Core\Resource\Folder, null given,

Actions #15

Updated by Maarten Mandemaker over 10 years ago

Confirmed ke_search uses this feature. Is there a patch for 6.2.0beta2 ?

Actions #16

Updated by Gerrit Code Review about 10 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26720

Actions #17

Updated by Gerrit Code Review about 10 years ago

Patch set 2 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26720

Actions #18

Updated by Gerrit Code Review about 10 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27087

Actions #19

Updated by Gerrit Code Review about 10 years ago

Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27088

Actions #20

Updated by Gerrit Code Review about 10 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27087

Actions #21

Updated by Gerrit Code Review about 10 years ago

Patch set 2 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27088

Actions #22

Updated by Gerrit Code Review about 10 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27087

Actions #23

Updated by Markus Günther about 10 years ago

I create a small extension to test the behavior. So it is
easier to test for all of you.

You can find the extension on github.
https://github.com/markusguenther/internaltype

Only clone it in your typo3conf/ext folder.

cd typo3conf/ext
git clone https://github.com/markusguenther/internaltype.git

After clearing the cache you can create a new record from type test object and can use the element browser for the property album.

Thats all. Thanks for testing!

Actions #24

Updated by Gerrit Code Review about 10 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27087

Actions #25

Updated by Gerrit Code Review about 10 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27087

Actions #26

Updated by Gerrit Code Review about 10 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27087

Actions #27

Updated by Gerrit Code Review about 10 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27087

Actions #28

Updated by Gerrit Code Review about 10 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27087

Actions #29

Updated by Gerrit Code Review about 10 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27087

Actions #30

Updated by Gerrit Code Review about 10 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27087

Actions #31

Updated by Daniel Ostmann almost 10 years ago

This patch did not solved it in 6.2.0.

I applied the last patch, then the folder tree appears. But now a can't select any folder without an exception:

#1392409507: Invalid form/module token detected. Access Denied! (More information)

UnexpectedValueException thrown in file
/<path>/typo3/mod.php in line 39.

Actions #32

Updated by Jörg Leshel over 9 years ago

Bump!

<settings.flex_startingpoint>
  <TCEforms>
    <exclude>1</exclude>
    <label>LLL:EXT:dummy/Resources/Private/Language/locallang_db.xlf:settings.flex_startingpoint</label>
    <config>
      <type>group</type>
      <internal_type>folder</internal_type>
      <minitems>0</minitems>
      <maxitems>1</maxitems>
      <size>1</size>
    </config>
  </TCEforms>
</settings.flex_startingpoint>

PHP Catchable Fatal Error: Argument 1 passed to TYPO3\CMS\Recordlist\Browser\ElementBrowser::TBE_expandSubFolders() must be an instance of TYPO3\CMS\Core\Resource\Folder, null given, called in /typo3_src-6.2.4/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php on line 1526 and defined in /typo3_src-6.2.4/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php line 1730

Update from 6.2.0 to 6.2.4 because of this issue - still same

Would be great if you could fix this in the short run

Need to finish an ext in the next few weeks in which the user has to be able to pic a folder as a starting point

Actions #33

Updated by Rafael Kähm over 9 years ago

Some additional infos:

If using folder in FlexForms i get following error from error log:

PHP Fatal error: Call to a member function checkActionPermission() on a non-object in 
.../typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php 
on line 1732, 
referer: http://www.vagrant-typo3.dev/typo3/browser.php?mode=folder&bparams=data[tt_content][177][pi_flexform][data][sDEF][lDEF][settings.explorer.root][vDEF]||||"

By changing

<internal_type>folder</internal_type>

to
<internal_type>file</internal_type>

and choosing some file and save changes(***).

and then changing back to

<internal_type>folder</internal_type>

it is possible to create new entries and choose folders or change created above entries(^ ***).

But by relogin in Backend i get Fatal errors from above again.

Actions #34

Updated by Alexander Rothmund over 9 years ago

I can confirm that, using the current state of the patch, I am also getting the error message upon attempting to navigate through the tree on the left.

#1392409507: Invalid form/module token detected: Access Denied! (More information)

UnexpectedValueException thrown in file
.../www/typo3_src/typo3/mod.php in line 26.

However, selecting the folder displayed by default on the right works.

Tested in TYPO3 6.2.7.

Actions #35

Updated by Ingo Schmitt about 9 years ago

  • Target version set to 7.1 (Cleanup)
  • TYPO3 Version changed from 6.0 to 6.2
  • Sprint Focus set to On Location Sprint
Actions #36

Updated by Alexander Opitz about 9 years ago

  • TYPO3 Version changed from 6.2 to 6.0

This issue started with TYPO3 6.0, so please don't change this number.

Actions #37

Updated by Alexander Opitz about 9 years ago

Is this issue fixed with latest git revision of TYPO3 7?

Actions #38

Updated by Alexander Opitz about 9 years ago

  • Status changed from Under Review to Needs Feedback
Actions #39

Updated by Josef F. Glatz (Old User) about 9 years ago

This issue is fixed in 6.2.10rc1!

Actions #40

Updated by Wouter Wolters about 9 years ago

  • Status changed from Needs Feedback to Closed
Actions #41

Updated by Markus Günther about 9 years ago

Big kudos and thanks to all involved developers :)

Actions #42

Updated by Anja Leichsenring about 8 years ago

  • Sprint Focus deleted (On Location Sprint)
Actions

Also available in: Atom PDF