8000 [Doctrine] Custom mapping type is not marked to be commented · Issue #2810 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Doctrine] Custom mapping type is not marked to be commented #2810

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
pkruithof opened this issue Dec 8, 2011 · 5 comments
Closed

[Doctrine] Custom mapping type is not marked to be commented #2810

pkruithof opened this issue Dec 8, 2011 · 5 comments
Assignees
Labels

Comments

@pkruithof
Copy link
Contributor

After creating a custom Doctrine mapping type, I noticed the doctrine:schema:update command always generated the same ALTER TABLE query. After some reverse engineering I saw that this was because the columns that have this type don't have a typical DC2Type:CustomType comment. New mapping types are not marked as having to be commented, as per the Doctrine reference.

I don't know if this should be fixed in the Doctrine Bundle, or in Doctrine's register method, but it seems incomplete right now.

@stof
Copy link
Member
stof commented Dec 8, 2011

@fabpot should it be considered as a new feature (so for master) or as a bug fix ?
I want to do it in the clean way, so making it configurable (as some custom mapping types don't need to be commented to be recognized). This will require changing the configuration for custom types but I think I can keep the BC.

@beberlei if this goes to master, should it go to the symfony repo or directly to the separate DoctrineBundle repo ? When will the split be completed by removing it from the symfony repo ?

@ghost ghost assigned stof Dec 8, 2011
@beberlei
Copy link
Contributor

This is a doctrine issue only imho, a DoctrineType should have an additional method "requiresMarkAsComment" that is evaluated in "registerMappingType()".

@stof
Copy link
Member
stof commented Dec 12, 2011

@beberlei there is already a method to register it as commented type IIRC. But it has to be done explicitly.

So what is the decision ? changing it in Doctrine itself ?

@lsmith77
Copy link
Contributor

ping

@beberlei
Copy link
Contributor

Its a Doctrine bundle issue, see doctrine/DoctrineBundle#6

fabpot added a commit that referenced this issue Aug 23, 2021
…(carlcasbolt)

This PR was merged into the 5.4 branch.

Discussion
----------

[HttpKernel] Fix timestamp_rfc3339 in LoggerDataCollector

Found that this was still needed for some log items to avoid an error in Profiler

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Ticket | Fixes #42622
| License       | MIT

Fix for the following error on Web Profiler when looking at error logs

```
[2021-08-17T10:30:06.093284+00:00] request.CRITICAL: Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("Warning: Undefined array key "timestamp_rfc3339"")." at /app/vendor/symfony/web-profiler-bundle/Resources/views/Collector/logger.html.twig line 49 {"exception":"[object] (Twig\\Error\\RuntimeError(code: 0): An exception has been thrown during the rendering of a template (\"Warning: Undefined array key \"timestamp_rfc3339\"\"). at /app/vendor/symfony/web-profiler-bundle/Resources/views/Collector/logger.html.twig:49)\n[previous exception] [object] (ErrorException(code: 0): Warning: Undefined array key \"timestamp_rfc3339\" at /app/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php:112)"} []
```

Found this issue on a new 5.4 project build today

Expected data shape is
```
array:7 [▼
  "timestamp" => Symfony\Component\VarDumper\Cloner\Data {#2810 ▶}
  "timestamp_rfc3339" => Symfony\Component\VarDumper\Cloner\Data {#2622 ▶}
  "message" => Symfony\Component\VarDumper\Cloner\Data {#2811 ▶}
  "priority" => Symfony\Component\VarDumper\Cloner\Data {#2812 ▶}
  "priorityName" => Symfony\Component\VarDumper\Cloner\Data {#2813 ▶}
  "context" => Symfony\Component\VarDumper\Cloner\Data {#2814 ▶}
  "channel" => Symfony\Component\VarDumper\Cloner\Data {#2815 ▶}
]
```

However I'm seeing this shape for `Please install the "intl" PHP extension for best performance.`
```
array:8 [▼
  "message" => Symfony\Component\VarDumper\Cloner\Data {#2905 ▶}
  "context" => Symfony\Component\VarDumper\Cloner\Data {#2717 ▶}
  "timestamp" => Symfony\Component\VarDumper\Cloner\Data {#2906 ▶}
  "priority" => Symfony\Component\VarDumper\Cloner\Data {#2907 ▶}
  "priorityName" => Symfony\Component\VarDumper\Cloner\Data {#2908 ▶}
  "channel" => Symfony\Component\VarDumper\Cloner\Data {#2909 ▶}
  "scream" => Symfony\Component\VarDumper\Cloner\Data {#2910 ▶}
  "errorCount" => Symfony\Component\VarDumper\Cloner\Data {#2911 ▶}
]
```
![image](https://user-images.githubusercontent.com/1097038/129744965-3cb18a81-5083-446d-af7e-d1209dde9eb5.png)

Commits
-------

967dee3 [HttpKernel] Fix timestamp_rfc3339 in LoggerDataCollector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
0