Bug #32063
LinkViewhelper is not working with custom type number
| 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?
Associated revisions
[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
- File 32063.diff added
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
Applied in changeset eee59cf0c3ca0b6d5f7d62b0822239d64af4432d.