Bug #9090

Chaining of ->assign() does not work anymore

Added by Michael Feinbier about 5 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2010-07-30
Priority:Must have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:View
Target version:-
Has patch: Affected Flow version:

Description

Since the latest release of Fluid the chaining of the ->assign() method does not work anymore

$this->view
  ->assign('request', $request)
  ->assign('languages', $this->languageRepository->findActive());

Throws error Fatal error: Call to a member function assign() on a non-object

9090_FLOW3_v1.patch Magnifier - patch for FLOW3 package (18.7 kB) Bastian Waidelich, 2010-08-02 15:24

9090_Fluid_v1.patch Magnifier - patch for Fluid package (10 kB) Bastian Waidelich, 2010-08-02 15:24

9090_tx_extbase_v1.patch Magnifier - patch for extbase extension (3.2 kB) Bastian Waidelich, 2010-08-02 15:24

9090_tx_fluid_v1.patch Magnifier - patch for fluid extension (10 kB) Bastian Waidelich, 2010-08-02 15:24


Related issues

related to TYPO3.Flow - Task #9136: Clean up View implementations Resolved 2010-08-04

Associated revisions

Revision d403729c
Added by Bastian Waidelich almost 5 years ago

[+BUGFIX] Fluid (View): AbstractTemplateView now correctly implements F3\FLOW3\MVC\View\ViewInterface and assign() and assignMultiple() will return an instance of $this to allow chaining again like $this->view->assign()->assign()... This fixes #9090

History

#1 Updated by Bastian Waidelich about 5 years ago

  • Category changed from Core to View

The feature of chaining variable assignments was added with r2899
Since r4659 This feature was (unintentionally?) removed

Note: I think the assign functions should be moved back to FLOW3/Extbase AbstractView.
Or at least they should be defined in the global ViewInterface.

Note2: For v4 we should consider re-adding this for the Hotfix releases (1.1.x)

#2 Updated by Bastian Waidelich about 5 years ago

Attached patches fixes the issue by adapting the interface and concrete view implementations. Additionally they add some unit tests and cleanups.

@Sebastian: Could you please check & apply (a subset of) the attached extbase & fluid patches for the Hotfix release? Afterwards feel free to re-assign this to me, so I can commit the rest to trunk.

#3 Updated by Bastian Waidelich almost 6 years ago

  • Assigned To changed from Sebastian Kurfuerst to Bastian Waidelich

I'll take care of this (for trunks of FLOW3, Fluid, tx_extbase & tx_fluid)

#4 Updated by Bastian Waidelich almost 6 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset r4931.

Also available in: Atom PDF