- Issue created by @samit.310@gmail.com
- Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 4:10am 22 February 2023 - š®š³India Ranjit1032002
I had Reviewed the patch and it's working as expected mentioned in comment #2
- Status changed to RTBC
almost 2 years ago 5:04am 22 February 2023 - Status changed to Needs work
almost 2 years ago 9:57am 24 February 2023 - š®š¹Italy apaderno Brescia, š®š¹
+/** + * The AdvancedTitleBlockForm Class. + */ class AdvancedTitleBlockForm extends ConfigFormBase {
A documentation comment for a class should not just repeat the class name. (Class is not correct, since it is not a the beginning of a sentence.)
- // @toDo validate and clean up submissions + // @todo validate and clean up submissions }
What follows
@todo
is a sentence. - Assigned to vishaljd
- @vishaljd opened merge request.
- Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 12:48pm 1 March 2023 - Status changed to Needs work
almost 2 years ago 4:54pm 1 March 2023 - š®š¹Italy apaderno Brescia, š®š¹
- // @toDo validate and clean up submissions + // '@toDo validate and clean up submissions'
Putting that part in quote characters is wrong.
+ * @param \Drupal\Core\File\FileUrlGenerator $url_generator + * File url generator.
The article is missing and url is not spelled correctly.
- '#title' => t('Default background image'), - '#open' => TRUE, // Controls the HTML5 'open' attribute. Defaults to FALSE. + '#title' => $this->t('Default background image'), + '#open' => TRUE, /* Controls the HTML5 'open' attribute. Defaults to FALSE. */
The comment delimiters are already correct. I am not sure that comment is necessary, though.
+ /** + * Get field from field_storage_config. + */
Parameters and return value are still not documented.
- First commit to issue fork.
- @kkalashnikov opened merge request.
- Status changed to Needs review
almost 2 years ago 10:34am 2 March 2023 - Status changed to Needs work
almost 2 years ago 2:45pm 2 March 2023 - š®š¹Italy apaderno Brescia, š®š¹
+ /** + * File url generator object.
Acronyms are written all uppercase. object is not used in the description of properties. The article is missing.
+ /** + * The Messenger service. + * + * @var Drupal\Core\Logger\LoggerChannelFactory + */ + protected $loggerFactory;
It is not the messenger service.
+ /** + * {@inheritdoc} + */ public function getFields($type, $entity = 'node') {
For a method that is not inherited nor defined in an interface, that comment cannot be used.
- Status changed to Needs review
over 1 year ago 7:20am 24 March 2023 - Status changed to Needs work
over 1 year ago 8:10am 24 March 2023 - š®š¹Italy apaderno Brescia, š®š¹
+/** + * Provides a advanced title block form. + */
The used article is wrong.
public function validateForm(array &$form, FormStateInterface $form_state) { - // @toDo validate and clean up submissions + }
Since that is a
@todo
tag for an empty method, it is correct to leave it, but it needs to be fixed: It is@todo
, not@toDo
; what follows@todo
is a sentence.+ /** + * The File URL generator service. + * + * @var \Drupal\Core\File\FileUrlGenerator + */ + protected $fileUrlGenerator;
File is not spelled correctly, since it is not the first word of a sentence.
+ /** + * The Logger service. + * + * @var Drupal\Core\Logger\LoggerChannelFactory + */ + protected $loggerFactory; +
The same is true for Logger. Then, that is the logger factory service.
/** * Constructs a new AdvancedTitleBlock. * @@ -82,14 +104,23 @@ class AdvancedTitleBlock extends BlockBase implements ContainerFactoryPluginInte * The route match. * @param \Drupal\Core\Config\ImmutableConfig $config * The configuration object. + * @param \Drupal\Core\File\FileUrlGenerator $fileUrlGenerator + * File url generator object. + * @param \Drupal\Core\File\FileSystem $fileSystem + * The fileSystem service. + * @param \Drupal\Core\Logger\LoggerChannelFactory $logger_factory + * The Messenger service. */
There is a missing article.
Then, since that documentation comment is changed, the class name must include its namespace.- \Drupal::logger('Advanced Title Block')->error('Failed uploading background image'); + $this->loggerFactory->get('Advanced Title Block')->error('Failed uploading background image');
It is correct to avoid
\Drupal
, but instead of calling$this->loggerFactory->get('Advanced Title Block')
every time the logger is necessary, it is sufficient to store the logger into a class property, instead of storing the logger factory.+ /** + * Get field names. + * + * @param array|string $type + * The field type. + * @param string $entity + * The entity type. + */
The return value is not documented.
The short description can be made better. - Status changed to Needs review
over 1 year ago 7:00am 15 April 2023 - šŖšŖEstonia rang501 Viljandi
Took some time and made multiple fixes. Should address last comment and additionally adds cache tags (block didn't update when entity was updated).
There were also issues like file upload validators were in wrong format, LoggerChannelFactory in construct was throwing fatals errors (due to redirect module, should use interface instead).
- Status changed to Needs work
7 months ago 9:08am 31 May 2024 Hi @rang501,
I applied your patch #19, some files of the patch did not apply successfully which may be the reason it still threw the errors below.
advanced_title_block git:(1.0.x) curl https://www.drupal.org/files/issues/2023-09-19/3343584-fixes-19.patch | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 14299 100 14299 0 0 42087 0 --:--:-- --:--:-- --:--:-- 43330 patching file README.md patching file advanced_title_block.menu.yml patching file advanced_title_block.routing.yml patching file config/schema/advanced_title_block.schema.yml patching file css/advanced-title-block.css patching file src/Form/AdvancedTitleBlockForm.php patching file src/Plugin/Block/AdvancedTitleBlock.php Hunk #6 FAILED at 196. Hunk #9 FAILED at 259. 2 out of 16 hunks FAILED -- saving rejects to file src/Plugin/Block/AdvancedTitleBlock.php.rej ā advanced_title_block git:(1.0.x) ā cd .. ā contrib git:(main) ā phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig advanced_title_block FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/advanced_title_block/src/Plugin/Block/AdvancedTitleBlock.php ---------------------------------------------------------------------------------------------------------------------------------------------- FOUND 6 ERRORS AND 4 WARNINGS AFFECTING 8 LINES ---------------------------------------------------------------------------------------------------------------------------------------------- 7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Block\BlockBase. 199 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 200 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters 200 | ERROR | [x] Comments may not appear after statements 204 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead 211 | ERROR | [x] Comma not allowed after last value in single-line array declaration 211 | ERROR | [x] Expected one space after the comma, 0 found 261 | ERROR | [x] Whitespace found at end of line 268 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead 364 | ERROR | [x] Data types in @var tags need to be fully namespaced ---------------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------------------------------------------------------------------------------- Time: 243ms; Memory: 12MB
Kindly check
Thanks,
Jake- š®š¹Italy apaderno Brescia, š®š¹
apaderno ā changed the visibility of the branch phpcs-3343584 to hidden.
- Status changed to Needs review
7 months ago 3:44pm 31 May 2024 - š®š¹Italy apaderno Brescia, š®š¹
apaderno ā changed the visibility of the branch coding_standard to hidden.