Epic #73121

Render() method arguments should be moved to initializeArguments()

Added by Claus Due over 4 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
Start date:
2016-07-01
Due date:
% Done:

100%

Sprint Focus:

Description

To prevent any errors with PHP7 and subclassed ViewHelpers if/when render() method signatures change. Moving the argument registrations away from the render() method means the render() method signature will never change, making it safe to subclass. Medium complexity due to size of code base needing changes.


Subtasks

Task #76907: Move method arguments to initializeArguments() in ext:belogClosedWouter Wolters

Task #76909: Move method arguments to initializeArguments() in ext:beuserClosedWouter Wolters

Task #76911: Move method arguments to initializeArguments() in ext:frontendRejected

Task #76912: Move method arguments to initializeArguments() in ext:installClosed

Task #76913: Move method arguments to initializeArguments() in ext:extensionmanagerClosed

Task #76914: Move method arguments to initializeArguments() in ext:fluidClosed

Task #76999: TestViewHelper: Move method arguments to initializeArguments() in ext:fluid ClosedAnna Färber

Task #77000: HtmlentitiesViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedAnna Färber

Task #77002: UrlencodeViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedIvaylo Ivanov

Task #77004: FlashMessagesViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77003: TestViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedIvaylo Ivanov

Task #77005: CaseViewHelperTest: Move method arguments to initializeArguments() in ext:fluidClosedAnna Färber

Task #77006: TypolinkViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77010: ResourceViewHelperClosedRoberto Torresani

Task #77012: EmailViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77013: ActionViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77007: HtmlentitiesDecodeViewHelperTest: Move method arguments to initializeArguments() in ext:fluidClosedNicole Cordes

Bug #77008: StripTagsViewHelperTest: Move method arguments to initializeArguments() in ext:fluidClosedIvaylo Ivanov

Task #77009: DateViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedAnna Färber

Task #77011: DateViewHelperTest: Move method arguments to initializeArguments() in ext:fluidRejected

Task #77023: RadioViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77014: ExternalViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77015: PageViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77016: ImageViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedNicole Cordes

Task #77017: ValidationResultsViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77018: ButtonViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77026: Introduce helper method to set arguments for viewhelper test casesClosedAnja Leichsenring

Task #77032: TextfieldViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77036: CheckboxViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77038: CropViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77039: DateViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77046: BytesViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedIvaylo Ivanov

Task #77047: NumberViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77056: CurrencyViewHelper: ClosedNicole Cordes

Task #77063: UrlencodeViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77064: Nl2brViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77065: FormViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedNicole Cordes

Task #77124: UriViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77125: LinkViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77126: PaginateViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77127: TranslateViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77128: CshViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77129: TableListViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77130: PageRendererViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77132: ActionMenuItemGroupViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77133: ActionMenuItemViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77131: ActionMenuViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77139: ContainerViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedNicole Cordes

Task #77140: InfoboxViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedNicole Cordes

Task #77141: DebugViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #77142: MediaViewHelper: Move method arguments to initializeArguments() in ext:fluidClosedRoberto Torresani

Task #76915: Move method arguments to initializeArguments() in ext:indexed_search and ext:filelistClosed

Task #76916: Move method arguments to initializeArguments() in several sysextsClosed

Bug #77529: Move missing method arguments to initializeArguments() in ext:fluidClosedNicole Cordes


Related issues

Related to TYPO3 Core - Bug #63083: Streamline Arguments in link and uri typolink Viewhelper Closed 2014-11-19

History

#1 Updated by Claus Due over 4 years ago

  • Category set to Fluid

#2 Updated by Helmut Hummel over 4 years ago

  • Status changed from New to Needs Feedback

Imho subclassing view helpers is an anti pattern.

VHs should not be open for subclassing and should be considered final.

If we have shared functionality, this should be encapsuled in a classed and composition should be used in the VHs in question to pull this functionality in.
See ImageViewHelper as an example.

#3 Updated by Helmut Hummel over 4 years ago

To be clear: I would support to introduce the requirement to use `initializeArguments()` but for other reasons:

We can add the render method and the initializeArguments methods to the interface with the following benefits:

  • Clearer API (only one style to do things)
  • It is a much clearer contract for VH authors
  • It reduces runtime magic resoliving

#4 Updated by Helmut Hummel over 4 years ago

To make this reality the following things need to be done:

  1. Change all core VHs
  2. Deprecate render methods with arguments (with target for removal in 9)

#5 Updated by Claus Due over 4 years ago

There are other benefits than being able to subclass the ViewHelpers. For example, avoiding the reflection framework and becoming a better Fluid citizen (not requiring special execution handling to support render method arguments).

As such, the topic of this discussion should not be "should be allow subclassing ViewHelpers" but rather "should we move argument registrations to avoid reflection and executions only supported on TYPO3 CMS". Whether or not we should even allow subclassing ViewHelpers should be another discussion.

#6 Updated by Claus Due over 4 years ago

To make this reality the following things need to be done:

Yes, that is what I intend to do.

#7 Updated by Claus Due over 4 years ago

I would like to add here that we can actually scrap the render() method completely. It's not needed. If renderStatic exists, and it always does, that method can be called directly.

#8 Updated by Frank Naegler over 4 years ago

  • Target version set to 8.0

#9 Updated by Alexander Opitz about 4 years ago

  • Status changed from Needs Feedback to New
  • Target version changed from 8.0 to 8 LTS

#10 Updated by Wouter Wolters almost 4 years ago

  • Tracker changed from Bug to Epic

#11 Updated by Mathias Schreiber over 3 years ago

  • Status changed from New to Resolved

#12 Updated by Riccardo De Contardi over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF