-
Notifications
You must be signed in to change notification settings - Fork 13
Fixes annotations for gesso link field formatters #1002
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
base: 5.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,11 +3,12 @@ | |||||||||||||||||||||||||||
| namespace Drupal\gesso_helper\Element; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| use Drupal\Core\Render\Element\RenderElementBase; | ||||||||||||||||||||||||||||
| use Drupal\Core\Render\Element\RenderElement; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||
| * Provides an SVG icon element. | ||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||
| * @RenderElementBase("gesso_icon") | ||||||||||||||||||||||||||||
| * @RenderElement("gesso_icon") | ||||||||||||||||||||||||||||
|
Comment on lines
+6
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "GessoIcon.php" -type fRepository: forumone/gesso Length of output: 98 🏁 Script executed: fd -t f "GessoIcon.php" | head -20Repository: forumone/gesso Length of output: 96 🌐 Web query:
💡 Result: In Drupal 10 and Drupal 11, the render-element plugin annotation class is:
However, in Drupal 10.3+ and Drupal 11, core render/form elements are also (and increasingly) defined using PHP attributes:
Sources: 🏁 Script executed: cat -n gesso_helper/src/Element/GessoIcon.phpRepository: forumone/gesso Length of output: 1790 Import the annotation class, not the element base class. Line 6 imports Suggested fix-use Drupal\Core\Render\Element\RenderElement;
+use Drupal\Core\Render\Annotation\RenderElement;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||
| class GessoIcon extends RenderElementBase { | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don’t need this line since we never use
RenderElementin this file and Drupal automatically imports annotation classes.