Bug #61361

Fluid template path fallback doesn't work in TypoScript object FLUIDTEMPLATE

Added by Christian Toffolo about 5 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Fluid
Target version:
Start date:
2014-09-05
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

It looks like that the useful fallback feature of Fluid is implemented only in class TemplateView and not in class StandaloneView.

So a Typoscript like this doesn't work:

page {
  10 = FLUIDTEMPLATE
  10 {
  partialRootPath >
  partialRootPaths {
    10 = EXT:bootstrap_package/Resources/Private/Partials/Page/
    20 = EXT:my_extension/Resources/Private/Partials/Page/
  }
}

and produce a FE error:
Partial root path "typo3conf/ext/bootstrap_package/Resources/Private/Templates/Page/Partials" does not exist

IMHO, since this feature has been implemented in 6.2, it must be available also for TypoScript object FLUIDTEMPLATE and in TYPO3 6.2


Related issues

Related to TYPO3 Core - Bug #63066: FluidTemplateContentObject uses deprecated methods Closed 2014-11-19
Related to TYPO3 Core - Bug #63367: superfluous ucfirst() kills FE rendering with FLUIDTEMPLATE Closed 2014-11-27
Precedes TYPO3 Core - Bug #63380: FLUIDTEMPLATE: New fallback paths miss stdWrap Closed 2014-11-27

Associated revisions

Revision 3b6de8a3 (diff)
Added by Anja Leichsenring about 5 years ago

[FEATURE] Template Path fallback for Fluid Standalone View

TemplateView received the feature of template path fallback
configuration with issue #39868.
The same is missing for Standalone view and will be introduced
with this patch.

Change-Id: I1e854a356a4c7e9cfff773c8f56fe4a437f77920
Resolves: #61361
Related: #39868
Releases: master
Reviewed-on: http://review.typo3.org/32613
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>

Revision 1747ec19 (diff)
Added by Markus Klein almost 5 years ago

[FEATURE] Allow fallback paths in FLUIDTEMPLATE

Resolves: #61361
Releases: master, 6.2
Change-Id: I676722936892f164ae147d7f9abcb602e734ae7d
Reviewed-on: http://review.typo3.org/34343
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Frans Saris <>
Tested-by: Frans Saris <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

Revision f582179a (diff)
Added by Anja Leichsenring almost 5 years ago

[FEATURE] Template Path fallback for Fluid Standalone View

TemplateView received the feature of template path fallback
configuration with issue #39868.
The same is missing for Standalone view and will be introduced
with this patch.

Change-Id: I1e854a356a4c7e9cfff773c8f56fe4a437f77920
Resolves: #61361
Related: #39868
Documentation: #63117
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/34344
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: ian excedo <>
Tested-by: ian excedo <>
Reviewed-by: Stefan Neufeind <>
Reviewed-by: Oliver Hader <>

Revision 145c36e2 (diff)
Added by Markus Klein almost 5 years ago

[FEATURE] Allow fallback paths in FLUIDTEMPLATE

Resolves: #61361
Releases: master, 6.2
Change-Id: I676722936892f164ae147d7f9abcb602e734ae7d
Reviewed-on: http://review.typo3.org/34421
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: ian excedo <>
Tested-by: ian excedo <>
Reviewed-by: Robert Wildling <>
Tested-by: Robert Wildling <>

History

#1 Updated by Anja Leichsenring about 5 years ago

  • Project changed from Fluid to TYPO3 Core
  • Category set to Fluid
  • TYPO3 Version set to 6.2
  • Is Regression set to No

#2 Updated by Gerrit Code Review about 5 years ago

  • Status changed from New 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 http://review.typo3.org/32613

#3 Updated by Christian Toffolo about 5 years ago

Thank you for the patch.
I tested it but it seems that it doesn't work.

I used the same Typoscript of the bug report and now this error is produced in the FE:
Could not load partial file. Tried following paths: "typo3conf/ext/bootstrap_package/Resources/Private/Templates/Page/Partials/Navigation/Main.html", "typo3conf/ext/bootstrap_package/Resources/Private/Templates/Page/Partials/Navigation/Main".

#4 Updated by Gerrit Code Review about 5 years ago

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

#5 Updated by Gerrit Code Review about 5 years ago

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

#6 Updated by Gerrit Code Review about 5 years ago

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

#7 Updated by Gerrit Code Review about 5 years ago

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

#8 Updated by Gerrit Code Review about 5 years ago

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

#9 Updated by Gerrit Code Review about 5 years ago

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

#10 Updated by Gerrit Code Review about 5 years ago

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

#11 Updated by Gerrit Code Review about 5 years ago

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

#12 Updated by Gerrit Code Review about 5 years ago

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

#13 Updated by Gerrit Code Review about 5 years ago

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

#14 Updated by Gerrit Code Review about 5 years ago

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

#15 Updated by Gerrit Code Review about 5 years ago

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

#16 Updated by Gerrit Code Review about 5 years ago

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

#17 Updated by Gerrit Code Review about 5 years ago

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

#18 Updated by Gerrit Code Review about 5 years ago

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

#19 Updated by Anja Leichsenring about 5 years ago

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

#20 Updated by Christian Toffolo almost 5 years ago

Hello,
this bug has been marked Resolved one month ago but I don't see these changes in TYPO3_6-2-7-dev.

Btw, I manually updated the code of StandaloneView.php and it doesn't seems to work or I didn't get how to make it work.

My Typoscript related to this is:

...
partialRootPath >
partialRootPaths {
  10 = EXT:bootstrap_package/Resources/Private/Partials/Page/
  20 = EXT:iandefault/Resources/Private/Partials/Page/
}
...
I get this exception:
#1288092556: Could not load partial file. Tried following paths: "typo3conf/ext/bootstrap_package/Resources/Private/Templates/Page/Partials/Navigation/Main.html", "typo3conf/ext/bootstrap_package/Resources/Private/Templates/Page/Partials/Navigation/Main".

Am I missing something?

Thanks in advance for your help.

#21 Updated by Robert Wildling almost 5 years ago

Hi,

it seems that
dirname($this->templatePathAndFilename)

in
public function getLayoutRootPaths() {...} [line 208ff]

returns a path that always adds "[...]Page/" to the path.

#22 Updated by Christian Toffolo almost 5 years ago

Hi Robert,
thanks for the hint.
I'm not a core developer or and expert but as far as I know that is correct cause "$this->templatePathAndFilename" is the full path of the template.
Instead I think that the problem reside on how this var is used in class StandaloneView to get paths for Layouts or Partials cause this logic suppose that those paths are in subfolders of the Template folder and this never happens.

@Anja please, re-open this bug cause it's not resolved.
Thanks.

#23 Updated by Markus Klein almost 5 years ago

Guys, the code has not been merged into 6.2!
There is NO fallback for paths in 6.2.
It should work on current master though.

#24 Updated by Christian Toffolo almost 5 years ago

Guys, the code has not been merged into 6.2!

The target TYPO3 Version of this bug has been set to 6.2 by a core developer, so I expect this to work in 6.2.

There is NO fallback for paths in 6.2.

It's clear that there is no fallback for paths in 6.2, that's why I opened this bug report.

It should work on current master though.

I tested on current master 7.0-dev and it doesn't seem to work.

I used this simple Typoscript:

page = PAGE
page {
  10 = FLUIDTEMPLATE
  10 {
    file = fileadmin/Resources/Templates/Default.html
    layoutRootPaths {
      10 = fileadmin/Resources/Layouts/
    }
  }
}

Result:

Uncaught TYPO3 Exception
#1288092555: Could not load layout file. Tried following paths: "fileadmin/Resources/Templates/Layouts/Default.html", "fileadmin/Resources/Templates/Layouts/Default"

As you can see "Templates/" has been added to the path and it shouldn't be.

Again, please, reopen this bug cause it's not resolved.
Thanks

#25 Updated by Markus Klein almost 5 years ago

  • Status changed from Resolved to On Hold
  • Target version set to 7.0

Hi Ian,

the "Target version" has never been set for this issue as far as I can see. It was reported for 6.2.
Features may only be added to the master branch.

I'll ask Ernesto as Release Manager, if he would accept a backport to 6.2, but before we can do that we have to ensure it works on master. Hope that I can give this a test run soon.

#26 Updated by Markus Klein almost 5 years ago

  • Status changed from On Hold to Accepted
  • Priority changed from Should have to Must have

I had a deeper look now again:

  • Using multiple paths does not work with the TypoScript ContentObject FLUIDTEMPLATE. The feature is simply not implemented.
  • Only the StandaloneView itself is capable of fallback paths. So extensions may use it.
  • The patch merged for StandaloneView is actually not ok, as it deprecates methods that are still used in Core.

This indeed needs several followups.

#27 Updated by Markus Klein almost 5 years ago

Markus Klein wrote:

  • The patch merged for StandaloneView is actually not ok, as it deprecates methods that are still used in Core.

This is fixed with #63066.

#28 Updated by Christian Toffolo almost 5 years ago

Hi Markus,
I tested https://review.typo3.org/#/c/34340/ and is not working with TS mentioned above:

page = PAGE
page {
  10 = FLUIDTEMPLATE
  10 {
    file = fileadmin/Resources/Templates/Default.html
    layoutRootPaths {
      10 = fileadmin/Resources/Layouts/
    }
  }
}

Same result:
Uncaught TYPO3 Exception
#1288092555: Could not load layout file. Tried following paths: "fileadmin/Resources/Templates/Layouts/Default.html", "fileadmin/Resources/Templates/Layouts/Default".

Is that TS working for you?

#29 Updated by Gerrit Code Review almost 5 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 http://review.typo3.org/34343

#30 Updated by Markus Klein almost 5 years ago

  • Status changed from Under Review to Accepted

@Ian: https://review.typo3.org/#/c/34340/ was just about cleaning up some stuff. It does not fix this issue here. (that's why it references a different ticket)

#31 Updated by Gerrit Code Review almost 5 years ago

  • Status changed from Accepted to Under Review

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

#32 Updated by Gerrit Code Review almost 5 years ago

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

#33 Updated by Christian Toffolo almost 5 years ago

http://review.typo3.org/34343 works in 7.0dev

But unluckily http://review.typo3.org/34344 doesn't work in 6.2 tested with same TS setup in comment 28 it gives the same error.

#34 Updated by Gerrit Code Review almost 5 years ago

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

#35 Updated by Gerrit Code Review almost 5 years ago

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

#36 Updated by Markus Klein almost 5 years ago

  • Status changed from Under Review to Resolved

#37 Updated by Gerrit Code Review almost 5 years ago

  • Status changed from Resolved to Under Review

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

#38 Updated by Gerrit Code Review almost 5 years ago

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

#39 Updated by Markus Klein almost 5 years ago

@all

We have patches ready now for 6.2, please test these.

You have to apply
https://review.typo3.org/#/c/34344/4
and
https://review.typo3.org/#/c/34421/1

Please report feedback right in Gerrit and please don't forget to vote there as well, you'll earn points!
Thanks

#40 Updated by Christian Toffolo almost 5 years ago

Tested and voted +1. Thank you very much Markus!

#41 Updated by Anja Leichsenring almost 5 years ago

  • Status changed from Under Review to Resolved

#42 Updated by Riccardo De Contardi about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF