Skip to content
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

[TwigComponent] Poorly formatted deprecation in toolbar #1296

Closed
tacman opened this issue Nov 27, 2023 · 7 comments · Fixed by #1297
Closed

[TwigComponent] Poorly formatted deprecation in toolbar #1296

tacman opened this issue Nov 27, 2023 · 7 comments · Fixed by #1297

Comments

@tacman
Copy link
Contributor

tacman commented Nov 27, 2023

Symfony version(s) affected

6.4-RC

Description

I'm seeing a deprecation error in the toolbar that is poorly formatted

image

Even in the profiler page, it looks wrong:

image

The actual error is in vendor/symfony/ux-twig-component/src/DataCollector/TwigComponentDataCollector.php
on line 93, which I imagine will get fixed soon, but a related question is why this deprecation is showing up as it is.

How to reproduce

I can provide a repo if that helps, but at the moment I haven't been able to reproduce it with a simple repo.

(This issue was originally reported at symfony/symfony#52757)

@smnandre
Copy link
Member

As i said there, i'llfix tonight.

The weird thing is i cannot reproduce myself ...

@smnandre
Copy link
Member

smnandre commented Nov 27, 2023

Could you share the TwigComponent profiler screen ? (in private if needed)

And the versions of profiler and twig-component you're on ?

@tacman
Copy link
Contributor Author

tacman commented Nov 27, 2023

image

profiler: 6.4-RC1
twig-component v2.13.1

@smnandre
Copy link
Member

@tacman can you check this PR fixes things ? #1297

@tacman
Copy link
Contributor Author

tacman commented Nov 27, 2023

I forget how to test another fork/branch!

   "symfony/web-profiler-bundle": "dev-twig-component-profiler-int-float"

 "repositories": {
        "profiler":   {
            "type": "vcs",
            "url": "[email protected]:smnandre/ux.git"
        },

I get

composer update
Loading composer repositories with package information
Restricting packages listed in "symfony/symfony" to "^6.4"
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires symfony/web-profiler-bundle dev-twig-component-profiler-int-float, found symfony/web-profiler-bundle[2.0.7, ..., 2.8.x-dev, v3.0.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev, v6.0.0-BETA1, ..., 6.4.x-dev, v7.0.0-BETA1, ..., 7.1.x-dev] but it does not match the constraint.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

even with minimum-stability set to dev.

@smnandre
Copy link
Member

smnandre commented Nov 27, 2023

As UX is on a monorepo, it can be a bit trickier i guess

What i advice you is:

Let's say your app is in /home/your-app

Create a directory outside your app's one

mkdir /home/ux-fix

ChoiceA: If you use the github cli

cd /home/ux-fix
gh repo clone symfony/ux
gh pr checkout 1297

ChoiceB: or if you want to do it manually

Download the source code of the UX monorepo (of my PR)
--> https://github.com/smnandre/ux/archive/refs/heads/fix/twig-component-profiler-int-float.zip

link the symfony UX packages to your vendors

cd /home/ux-fix/ux
php link /home/your-app

test if everything is OK

restore your vendors where they were

php link /home/your-app --rollback

Update: just to insist, it is not in the profiler component, but in the TwigComponent

Every component has its own code related to the profiler

@tacman
Copy link
Contributor Author

tacman commented Nov 28, 2023

Thanks! I wasn't familiar with the gh pr checkout command, so much easier than the approach I was trying.

Yep, that fix works:

image

@tacman tacman closed this as completed Nov 28, 2023
weaverryan added a commit that referenced this issue Dec 1, 2023
This PR was merged into the 2.x branch.

Discussion
----------

[TwigComponent] Fix DataCollector return types

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Issues        | Fix #1296
| License       | MIT

Fix notices appears due to badly method type coercion (float -> int)

Commits
-------

1409bda Fix DataCollector return types
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 a pull request may close this issue.

2 participants