swentel / indieweb

IndieWeb integration for Drupal
https://drupal.org/project/indieweb
GNU General Public License v2.0
37 stars 5 forks source link

Missing dependency on externalauth in indieweb_indieauth #466

Closed eelkeblok closed 4 years ago

eelkeblok commented 4 years ago

The auth module makes use of functionality in the externalauth module, but it does not list it as a dependency, which means an exception will be thrown when the authentication block is added to a site.

swentel commented 4 years ago

Oh, good catch. The dependency doesn't have to be explicitly set because the IndieAuth module allows for external authentication to (meaning, not using the internal indieauth endpoint). The block should check whether the service exists or not and show a warning.

eelkeblok commented 4 years ago

I would suggest the configuration screen is also a good place to make the user aware of this. In fact, I think the block could simply state that authentication is not enabled (as it does now) and then in the configuration screen show a warning that the externelauth module needs to be enabled.

eelkeblok commented 4 years ago

Actually the code does try to cater for the service not existing by checking the value of the variable. Unfortunately, Drupal::service throws an exception for non-existing services. Having a crack at fixing this.

swentel commented 4 years ago

\Drupal::hasService() should work I think

swentel commented 4 years ago

committed to drupal.org as well see https://git.drupalcode.org/project/indieweb/commit/8db5799686dfa6b895676e5f855e426976e540e8

Looks like drupal.org misses the attribution though :/ I hope the pull request stuff starts working soon on d.o so I can move it over there ..

swentel commented 4 years ago

Crap it broke a test :) see https://www.drupal.org/pift-ci-job/1531894 Will have to figure out what's causing it.

swentel commented 4 years ago

Ok, easy fix, it actually forgot to return TRUE if an external account was found :)

eelkeblok commented 4 years ago

Oh no, that was silly :) No worries about the attribution, and I'm with you hoping for PRs on d.o. I'm doing an internal talk about the patch workflow soon, so maybe I can "jinx" it that way, have my talk rendered obsolete :)