Project

General

Profile

Actions

Bug #73207

closed

Changing the Template of a fluid widget does not work

Added by Stefan Froemken about 8 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Start date:
2016-02-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hello,

I want to change the template of a fluid widget with following TypoScript:

module.tx_devlog.view.widget.TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPaths {
  10 = EXT:devlog/Resources/Private/Templates/ViewHelpers/Widget/Paginate/Index.html
}

I have also tried that one:

module.tx_devlog.view.widget.TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPath = EXT:devlog/Resources/Private/Templates/ViewHelpers/Widget/Paginate/Index.html

While processing these values in Fluid, my template will be added AFTER the Fluid one. But in extractPathArrays you resort the values with krsort. Now my template is the first one and will be overwritten by Fluidtemplates again.

With my last idea I overwrite the full template path of Fluid:

module.tx_fluid.view.templateRootPaths {
  10 = EXT:devlog/Resources/Private/Templates/
}

Now my template path will be added BEFORE the Fluid one. In extractPathArray the templates will be resorted again and my template path is the last one. Yeah. That's correct.

Stefan


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #84575: Fluid autocomplete widget not working anymoreClosed2018-04-02

Actions
Actions #1

Updated by Claus Due about 8 years ago

Could you try "10 = EXT:devlog/Resources/Private/Templates/ViewHelpers/Widget/" instead, please? The values should be root paths (excluding the Widget's controller name) so the "Paginate/Index.html" part should be added when resolving the template. It's basically the same as putting nested view configuration in "widget.$className".

Actions #2

Updated by Wouter Wolters about 8 years ago

  • Status changed from New to Needs Feedback
Actions #3

Updated by Stefan Froemken about 8 years ago

Sorry. It doesn't work.

In setViewConfiguration() we have a call to $view->getTemplatePaths()->fillFromConfigurationArray() which sets my configuration. Everything is alright until now.

Just 2 or 3 Rows later canRender() will be called, which executes $this->setControllerContext(). The problem is here: $this->baseRenderingContext->getTemplatePaths()->fillDefaultsByPackageName($request->getControllerExtensionKey()); which overwrites my previously (correct) defined settings with defaults again.

Stefan

Actions #4

Updated by Frank Nägler about 8 years ago

For news the overwrite looks like this:

plugin.tx_news.view.widget.GeorgRinger\News\ViewHelpers\Widget\PaginateViewHelper.templateRootPath = EXT:news/Resources/Private/Templates/

can you try this with adapted paths?

Actions #5

Updated by Stefan Froemken about 8 years ago

I have tried these versions now:

module.tx_devlog.view.widget.TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPaths {
10 = EXT:devlog/Resources/Private/Templates/
}

and

module.tx_devlog.view.widget.TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPath = EXT:devlog/Resources/Private/Templates/

Both does not work.

Actions #6

Updated by Alex Kellner almost 8 years ago

Can confirm this. It's not possible to set an own HTML-Template in my backend module for TYPO3 8.0

module.tx_powermail {
    view {
        widget.TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPath = EXT:powermail/Resources/Private/Templates/
        widget.TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPaths {
            10 = EXT:powermail/Resources/Private/Templates/
        }
    }
}

templateRootPath seems to work in 7.6

Actions #7

Updated by Benni Mack almost 8 years ago

  • Target version changed from 8.0 to 8.2
Actions #8

Updated by Benni Mack over 7 years ago

  • Target version changed from 8.2 to 8.3
Actions #9

Updated by Benni Mack over 7 years ago

  • Target version changed from 8.3 to 8.4
Actions #10

Updated by Dominik Hahn over 7 years ago

Hey guys,

the same happened to me today, after updating TYPO3 CMS to the latest dev-master.

We have two extensions:
The first one defines the paths to it's templates by using templateRootPaths.1
the second extension extends those paths (and overwrites certain templates) by using templateRoothPaths.10

I was wondering why the templates of the second extension (albeit the higher index) were not showing up in the templates after performing the update.

Debugging the method 'getContextSpecificViewConfiguration()' of the 'TemplatePaths' class with a var_dump() I have learnt that this function seems to be executed twice for every plugin on the page.

On the first call:

/srv/www/public/sites/debugging/vendor/typo3/cms/typo3/sysext/fluid/Classes/View/TemplatePaths.php:116:
array (size=3)
  0 => string '/srv/www/public/sites/debugging/Web/typo3conf/ext/custom_extension/Resources/Private/Templates/' (length=106
  1 => string '/srv/www/public/sites/debugging/Web/typo3conf/ext/custom_extension/Resources/Private/Templates/Plugins/' (length=114)
  10 => string '/srv/www/public/sites/debugging/Web/typo3conf/ext/custom_extension_two/Resources/Private/Templates/Extensions/Demo/Plugins/' (length=146)

On the second call:

/srv/www/public/sites/debugging/vendor/typo3/cms/typo3/sysext/fluid/Classes/View/TemplatePaths.php:116:
array (size=3)
  0 => string '/srv/www/public/sites/debugging/Web/typo3conf/ext/custom_extension_two/Resources/Private/Templates/Extensions/Demo/Plugins/' (length=146)
  1 => string '/srv/www/public/sites/debugging/Web/typo3conf/ext/custom_extension/Resources/Private/Templates/Plugins/' (length=114)
  2 => string '/srv/www/public/sites/debugging/Web/typo3conf/ext/custom_extension/Resources/Private/Templates/' (length=106)

I guess the second call wins, the index of my custom templates is set to "0" and the default templates are loaded.

It all drills down to the setControllerContext method of the AbstractTemplateView as already pointed out in https://forge.typo3.org/issues/73207#note-3

I really hope this helps resolving this annoying problem.
As a temporary fix, I am completely overwriting templateRootPaths.1 in my second extension.

Actions #11

Updated by Benni Mack over 7 years ago

  • Target version changed from 8.4 to 8.5
Actions #12

Updated by Frank Nägler over 7 years ago

  • Status changed from Needs Feedback to Accepted
Actions #13

Updated by Mark Watney over 7 years ago

I can also can confirm this with TYPO3 CMS 8.5.0.

Actions #14

Updated by Gerrit Code Review about 7 years ago

  • Status changed from Accepted to Under Review

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/51057

Actions #15

Updated by Benni Mack about 7 years ago

  • Target version changed from 8.5 to 8.6
Actions #16

Updated by Benni Mack about 7 years ago

  • Target version changed from 8.6 to 8 LTS
Actions #17

Updated by Benni Mack almost 7 years ago

  • Target version changed from 8 LTS to next-patchlevel
Actions #18

Updated by Denis Mir over 6 years ago

I can confirm this issue on TYPO3 8.7.6. It is still not possible to override the template of the paginate widget. (I have tried out several ways of configuring it) Neither `templateRootPath` nor `templateRootPaths` does work.

Actions #19

Updated by Gerrit Code Review over 6 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/54140

Actions #20

Updated by Gerrit Code Review over 6 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/54140

Actions #21

Updated by Gerrit Code Review over 6 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/54140

Actions #22

Updated by Gerrit Code Review over 6 years ago

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

Actions #23

Updated by Gerrit Code Review over 6 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/54140

Actions #24

Updated by Gerrit Code Review over 6 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/53958

Actions #25

Updated by Gerrit Code Review over 6 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/54140

Actions #26

Updated by Gerrit Code Review over 6 years ago

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

Actions #27

Updated by Gerrit Code Review over 6 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/54140

Actions #28

Updated by Gerrit Code Review over 6 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/53958

Actions #29

Updated by Gerrit Code Review over 6 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/53958

Actions #30

Updated by Gerrit Code Review over 6 years ago

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

Actions #31

Updated by Gerrit Code Review over 6 years ago

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

Actions #32

Updated by Gerrit Code Review over 6 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/53958

Actions #33

Updated by Gerrit Code Review over 6 years ago

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

Actions #34

Updated by Helmut Hummel over 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #35

Updated by Gerrit Code Review over 6 years ago

  • Status changed from Resolved to Under Review

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

Actions #36

Updated by Gerrit Code Review over 6 years ago

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

Actions #37

Updated by Gerrit Code Review over 6 years ago

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

Actions #38

Updated by Gerrit Code Review over 6 years ago

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

Actions #39

Updated by Gerrit Code Review over 6 years ago

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

Actions #40

Updated by Gerrit Code Review over 6 years ago

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

Actions #41

Updated by Gerrit Code Review over 6 years ago

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

Actions #42

Updated by Gerrit Code Review over 6 years ago

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

Actions #43

Updated by Gerrit Code Review over 6 years ago

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

Actions #44

Updated by Gerrit Code Review over 6 years ago

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

Actions #45

Updated by Gerrit Code Review over 6 years ago

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

Actions #46

Updated by Gerrit Code Review over 6 years ago

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

Actions #47

Updated by Gerrit Code Review over 6 years ago

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

Actions #48

Updated by Gerrit Code Review about 6 years ago

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

Actions #49

Updated by Gerrit Code Review about 6 years ago

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

Actions #50

Updated by Gerrit Code Review about 6 years ago

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

Actions #51

Updated by Gerrit Code Review about 6 years ago

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

Actions #52

Updated by Gerrit Code Review about 6 years ago

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

Actions #53

Updated by Gerrit Code Review about 6 years ago

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

Actions #54

Updated by Gerrit Code Review about 6 years ago

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

Actions #55

Updated by Gerrit Code Review about 6 years ago

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

Actions #56

Updated by Gerrit Code Review about 6 years ago

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

Actions #57

Updated by Gerrit Code Review about 6 years ago

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

Actions #58

Updated by Gerrit Code Review about 6 years ago

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

Actions #59

Updated by Gerrit Code Review about 6 years ago

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

Actions #60

Updated by Gerrit Code Review about 6 years ago

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

Actions #61

Updated by Gerrit Code Review about 6 years ago

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

Actions #62

Updated by Gerrit Code Review about 6 years ago

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

Actions #63

Updated by Gerrit Code Review about 6 years ago

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

Actions #64

Updated by Gerrit Code Review about 6 years ago

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

Actions #65

Updated by Gerrit Code Review about 6 years ago

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

Actions #66

Updated by Riccardo De Contardi almost 6 years ago

  • Related to Bug #84575: Fluid autocomplete widget not working anymore added
Actions #67

Updated by Susanne Moog about 5 years ago

  • Status changed from Under Review to New

Path has been abandoned.

Actions #68

Updated by Benni Mack almost 5 years ago

  • Target version changed from next-patchlevel to Candidate for patchlevel
Actions #69

Updated by Claus Due about 4 years ago

  • Status changed from New to Resolved
Actions #70

Updated by Benni Mack almost 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF