Calling getExtraDetails when api_calls setting is empty at FacebookAuthController returnFromFb

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

shmel210 created an issue. See original summary.

shmel210’s picture

shmel210’s picture

Status: Needs work » Needs review
gvso’s picture

Title: Calling getExtraDetails when api_calls setting is empty » Not explode getExtraDetails when api_calls setting is empty
Status: Needs review » Needs work
Issue tags: -getApiCalls getExtraDetails returnFromFb FacebookAuthController
+++ b/src/Controller/FacebookAuthController.php
@@ -202,7 +202,8 @@ class FacebookAuthController extends ControllerBase {
+      $api_calls = $api_calls_string?explode(PHP_EOL, $api_calls_string):[];

I understand why you think this should be changed, but I wonder whether we can do this with only one variable.

Something like.
$api_calls = $api_calls ? explode($api_calls) : [];

Furthermore, we should follow coding standards, so the spaces between the operators are required.

shmel210’s picture

Status: Needs work » Needs review

Because variable api_calls changes its type from string to array. Its probably not well.

  • gvso committed 01055e5 on 8.x-2.x authored by shmel210
    Issue #2924974 by shmel210: Not explode getExtraDetails when api_calls...
gvso’s picture

Status: Needs review » Fixed

Committed with a small change (added spaces between the operators-operands)

Status: Fixed » Closed (fixed)

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