Skip to content

BUGFIX: FileTypeIconViewHelper should work with new $asset argument #2188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 0 commits into from

Conversation

chkoeppel
Copy link
Contributor

@chkoeppel chkoeppel commented Sep 21, 2018

If the newly added $asset argument is used, it's ignored and overridden to the deprecated $file argument.

Resolves #2186

@chkoeppel
Copy link
Contributor Author

Hi
I thought to be able for such a small selective code-fix ...
Apparently not ... I don't have an idea what's really wrong ? (Type "" not found ??)
Thanks for hint ...

@daniellienert
Copy link
Member

Hey @chkoeppel,

thanks for your first contribution to this repository!

The failed test is not your fault - have a look at the current build status: https://travis-ci.org/neos/neos-development-collection/branches - 4.1 is also broken without your change.

Cheers,
Daniel

@@ -75,7 +75,9 @@ public function initializeArguments()
*/
public function render(AssetInterface $file = null, AssetInterface $asset = null, string $filename = null, $width = null, $height = null)
{
$asset = $file;
if (!is_null($file)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhm with that, if you give both $asset and $file, the deprecated file would take precedence.

Nitpick using $file !== null is more common in the Neos code.

I would recomend:

if($asset === null) {
  $asset = $file;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

  • shall I adapt the code to your solution HERE ...
    (another commit, no ?)
    OR create a new PullRequest ? (squash)

@daniellienert
Copy link
Member

Sure, just amend your commit or add another and we’ll squash it while merging.

@aertmann aertmann changed the base branch from 4.1 to 4.0 September 25, 2018 20:33
@aertmann aertmann changed the base branch from 4.0 to 4.1 September 25, 2018 20:33
@aertmann aertmann changed the title BUGFIX: issue #2186 : if "asset" is used, it keeps its value BUGFIX: FileTypeIconViewHelper should work with new $asset argument Sep 25, 2018
@aertmann
Copy link
Contributor

Should actually go into 4.0 as that's the lowest branch the bug exists in https://github.com/neos/neos-development-collection/blob/4.0/Neos.Media/Classes/ViewHelpers/FileTypeIconViewHelper.php#L78

Copy link
Contributor

@aertmann aertmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should go into 4.0

@chkoeppel chkoeppel changed the base branch from 4.1 to 4.0 September 25, 2018 21:10
@chkoeppel
Copy link
Contributor Author

Really SORRY for all these inconvenience ...
I guess now, I have done another real mistake ... ??!

Should I have closed and reopen a new one ?!
Can you help me ?

@gerhard-boden
Copy link
Contributor

You'll have to reopen with the correct target branch (just reference the new PR from here and close this one). You can't change the target to a lower branch within a PR without this happening afaik, only higher is possible.

@aertmann
Copy link
Contributor

@chkoeppel Really don't be sorry, it's a bit of a complicated process when having to maintain multiple versions simultaneously. Happy to guide you through it. You haven't made any mistakes per say, we just need to make sure we target the lowest version with the bug so it can be fixed in all versions it's present in.

You have two options, either you can reset your existing branch to be based on 4.0 and then apply the change again and force push it. Alternatively you can create a new branch and open a new pull request. Either is fine, depends on your Git skill level.

@aertmann
Copy link
Contributor

If you wanna keep the existing PR and just update your branch, then you can change the base by clicking "Edit" next to the title.

@aertmann
Copy link
Contributor

Nvm you already did, then you just need to update your branch to be mergeable with 4.0 with your change applied on top.

@gerhard-boden
Copy link
Contributor

@aertmann I saw he is using 4.1 within his fork as base so while he could reset his 4.1 branch to the latest 4.0 commit (and put his commits on top), I think from this point it would be less complicated to just reopen? Maybe on a new bugfix branch based on 4.0?

@chkoeppel As Aske already said, no problem at all, we're all very happy to guide you trough the process which can be a little complicated at the beginning. Just ask anything that is unclear for you to proceed.

@chkoeppel
Copy link
Contributor Author

... just want to be sure what I do now, - I need some minutes of reflection before trying ...
Thanks anyway for your hints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants