Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork feeds-3426951

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

chaitanyadessai created an issue. See original summary.

chaitanyadessai’s picture

Assigned: chaitanyadessai » Unassigned
Status: Active » Needs review
StatusFileSize
new6.7 KB

Please review.

Status: Needs review » Needs work

The last submitted patch, 2: 3426951-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

megachriz’s picture

I think that at least some of the failing tests are caused by the following:

+++ b/modules/log/src/Plugin/Field/FieldFormatter/FileUriLinkFormatter.php
@@ -19,6 +21,32 @@ use Drupal\Core\Url;
+   * @param \Drupal\Core\File\FileSystemInterface $file_url_generator
+   *   The file URL generator.
+   */
+  public function __construct(FileSystemInterface $file_url_generator) {
+    $this->fileUrlGenerator = $file_url_generator;
+  }

The service 'file_url_generator' does probably not implement FileSystemInterface, so an other interface would need to be used here.

megachriz’s picture

+++ b/tests/modules/feeds_test_events/src/EventSubscriber/FeedsSubscriber.php
@@ -22,6 +24,34 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 class FeedsSubscriber implements EventSubscriberInterface {
 
+
...
+  /**
+   * The state handler service.
+   *
+   * @var \Drupal\Core\State\StateInterface
+   */
+  protected $state;
+
+  /**
+   * Constructs a FeedsSubscriber object.
+   *
+   * @param \Drupal\Core\State\StateInterface $state
+   *   The state handler service.
+   */
+  public function __construct(StateInterface $state) {
+    $this->state = $state;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('state'),
+    );
+  }

For classes that are a service, the services it depends on need to be declared in a [module].services.yml file. In this case that would be in "feeds_test_events.services.yml". And the service class should not have a static create() method as above.

I see also some extra returns in the patch file that could be removed.

Thanks for working on this. :)

chaitanyadessai’s picture

Assigned: Unassigned » chaitanyadessai
chaitanyadessai’s picture

Assigned: chaitanyadessai » Unassigned
Status: Needs work » Needs review
StatusFileSize
new6.75 KB

Please review.

chaitanyadessai’s picture

StatusFileSize
new6.75 KB

The last submitted patch, 7: 3426951-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Status: Needs review » Needs work

The last submitted patch, 8: 3426951-8.patch, failed testing. View results

megachriz’s picture

Status: Needs work » Needs review

In FileUriLinkFormatter, I made sure that the parent constructor gets called with the right parameters. Let's see if that makes the tests pass.

  • MegaChriz committed 83dd717e on 8.x-3.x
    Issue #3426951 by chaitanyadessai, MegaChriz: Fixed a few \Drupal calls...
megachriz’s picture

Status: Needs review » Fixed

I merged the code!

chaitanyadessai’s picture

Thanks @megachriz

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.