CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Bug #32063

LinkViewhelper is not working with custom type number

Added by Steffen Müller over 1 year ago. Updated over 1 year ago.

Status:Resolved Start date:2011-11-24
Priority:Should have Due date:
Assignee:- % Done:

100%

Category:-
Target version:-
TYPO3 Version:4.5 Has patch:No
PHP Version: Complexity:
Votes: 0

Description

The LinkViewhelper uses static values for type. e.g.:

if ($newsType === 0) {

So the viewhelper is limited to type 0,1 or 2.

Links do not work when I use a custom type which is added by a 3rd party extension.

So maybe it makes sense to add a default fallback:

if ($newsType === 0 || $newsType > 3) {

What do you think?

32063.diff (4 kB) Steffen Müller, 2011-11-25 10:52

Associated revisions

Revision eee59cf0
Added by Steffen Müller over 1 year ago

[BUGFIX] LinkViewhelper is not working with custom type number

Change-Id: I35c3d1b80854e198699733341ae31fcdcc079ee7
Resolves: #32063

History

Updated by Georg Ringer over 1 year ago

  • Status changed from New to Accepted

Better Check 1 and 2 First and everything in else...wanna do a patch to gerrit?

Updated by Steffen Müller over 1 year ago

Since I am not allowed to push to git, here's the patch.
I replaced the if condition with switch/case. IMO it provides better readability than if/elseif/elseif. Drawback is that switch/case comparison is not typesafe, but the news type is int in DB and TCA anyway.

Updated by Georg Ringer over 1 year ago

you are now allowed to push. btw there is an int cast for the type, so it is an integer

Updated by Mr. Jenkins over 1 year ago

Patch set 1 of change I35c3d1b80854e198699733341ae31fcdcc079ee7 has been pushed to the review server.
It is available at http://review.typo3.org/6914

Updated by Steffen Müller over 1 year ago

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

Also available in: Atom PDF