Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] ConfigDumpReferenceCommand uses yaml even when not present #38301

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
garak opened this issue Sep 25, 2020 · 1 comment · Fixed by #38394
Closed

[FrameworkBundle] ConfigDumpReferenceCommand uses yaml even when not present #38301

garak opened this issue Sep 25, 2020 · 1 comment · Fixed by #38394

Comments

@garak
Copy link
Contributor

garak commented Sep 25, 2020

Symfony version(s) affected: 5.1.5 (probably other versions, too)

Description
If you don't use symfony/yaml component, the command "config:dump-reference" is trying to use yaml as default value for "format" option, resulting in an error.

How to reproduce

  • create a symfony project without symfony/yaml component (or remove symfony/yaml component from an existing project).
  • try to dump configuration for any bundle, e.g. console config:dump-reference twig
  • see error (in YamlReferenceDumper.php line 111) :

Attempted to load class "Inline" from namespace "Symfony\Component\Yaml".
Did you forget a "use" statement for another namespace?

Possible Solution
A check for existance of above class should be added. If not present, default value of "format" option should be "xml" instead of "yaml".

@garak garak added the Bug label Sep 25, 2020
nicolas-grekas added a commit that referenced this issue Oct 6, 2020
… (jschaedl)

This PR was submitted for the master branch but it was squashed and merged into the 5.x branch instead.

Discussion
----------

[FrameworkBundle] Add check for installed yaml component

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #38301 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch master.
-->

**Todo:**

- [ ] add tests

Commits
-------

f174ad2 [FrameworkBundle] Add check for installed yaml component
@chalasr
Copy link
Member

chalasr commented Oct 17, 2020

Situation improved on 5.2 thanks to #38394.

@chalasr chalasr closed this as completed Oct 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants