Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, contact.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
2.98 KB
1.75 KB

Some small cleanup.

dawehner’s picture

FileSize
10.69 KB

Actually wrote a test and realized how much was actually broken, like it never actually appeared on some use-cases.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

Tested this, works, code looks great, tests looks complete, comments look great.

Awesome!

dawehner’s picture

FileSize
10.65 KB
560 bytes

Left the UUID in the test yml file.

catch’s picture

Status: Reviewed & tested by the community » Needs review

Is this really the only way to check the access? It's an extra query for every row when you enable this. I realise contextual module does it as well but it's a horrible pattern. The only thing I can think of though is doing what contact module does in its own callback.

+ $path = "user/$uid/contact";
+ $menu_item = menu_get_item($path);
+ if (!$menu_item['access']) {
+ return;
+ }

dawehner’s picture

We could rewrite _contact_personal_tab_access to accept multiple accounts, though I'm really wondering whether it's worth to do so,
as N function calls on N rows is nothing compared to all other things going on like entity API.

Would you be okay with directly calling the access method of contact? We didn't used that in D7 because people might want to replace the access logic and so could do this in one place via hook_menu_alter.

catch’s picture

I think directly calling the access method is probably OK. It's not that much different to calling node_access() really.

If you think that's too fragile, just adding a comment explaining why we have to use menu_get_item() there might be enough as well.

dawehner’s picture

FileSize
661 bytes
10.63 KB

To be honest, this is such an edge case that to require overriding the views handler is fine for me.

Status: Needs review » Needs work
Issue tags: -VDC

The last submitted patch, drupal-1853526-10.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review

#10: drupal-1853526-10.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, drupal-1853526-10.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review

#10: drupal-1853526-10.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, drupal-1853526-10.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review

#10: drupal-1853526-10.patch queued for re-testing.

dawehner’s picture

#10: drupal-1853526-10.patch queued for re-testing.

dawehner’s picture

#10: drupal-1853526-10.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, drupal-1853526-10.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review

#10: drupal-1853526-10.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +VDC

The last submitted patch, drupal-1853526-10.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
10.64 KB
7.78 KB

Moved some tiny bits around and fixed things here and there. The interdiff thought would be hard to read as files have been moved.

andypost’s picture

Issue tags: -VDC

#22: drupal-1853526-22.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +VDC

The last submitted patch, drupal-1853526-22.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
1.35 KB
10.66 KB

This should fix it.

Status: Needs review » Needs work

The last submitted patch, drupal-1853526-25.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
1.82 KB
10.67 KB

Now!

andypost’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php
@@ -0,0 +1,116 @@
+      $result = $this->xpath('//div[contains(@class, "views-field-contact")]//a[contains(@href, :uri)]', array(':uri' => $contact_uri));
+      $this->assertTrue(count($result));

AssertLink is not sufficient here?

dawehner’s picture

Yeah we could use it here, though it feels always safer for me, to check the full output here, as this adds additional kind of test coverage.

Feel free to convince me of the opposite, then I'm happy to rerole.

xjm’s picture

I think it's fine as-is.

xjm’s picture

Issue tags: -VDC

#27: drupal-1853526-27.patch queued for re-testing.

webchick’s picture

Issue tags: +VDC

#27: drupal-1853526-27.patch queued for re-testing.

tstoeckler’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/contact/tests/modules/contact_test_views/test_views/views.view.test_contact_link.yml
@@ -0,0 +1,119 @@
+human_name: test_contact_link

That should be label, I think.

damiankloip’s picture

Status: Needs work » Needs review
FileSize
658 bytes
10.67 KB

Good catch, we def need to change this since the label patch landed :)

dawehner’s picture

Issue tags: -VDC

#34: 1853526-34.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +VDC

The last submitted patch, 1853526-34.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
FileSize
6.55 KB
10.92 KB

Reroll. Unable to figure out Uncaught PHP Exception Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: "The service definition "plugin.manager.views.access" does not exist." at D:\xampp\htdocs\d8\core\vendor\symfony\dependency-injection\Symfony\Component\DependencyInjection\ContainerBuilder.php line 875

Status: Needs review » Needs work

The last submitted patch, 1853526-37.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
10.99 KB
2.89 KB

I shouted so many bad words while fixing those.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Great!

+++ b/core/modules/contact/lib/Drupal/contact/Plugin/views/field/ContactLink.phpundefined
@@ -0,0 +1,74 @@
+    if (!_contact_personal_tab_access($entity->getBCEntity())) {

Should be converted in #1938390: Convert contact_site_page and contact_person_page to a new-style Controller

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 1d3e064 and pushed to 8.x. Thanks!

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