Closed yenoomluap closed 3 years ago
@tool-rules , You should enter the email of one or more developers to invite them to the team, separated by comma in the form. I checked at my end and able to invite members to the team. You can refer https://www.drupal.org/docs/contributed-modules/apigee-edge/configure-team-management for the documentation.
Are you facing the issue with specific conditions or steps?
Yes @phdhiren I'm facing the issue of adding a member to a team. We have been able to do this in the past. It is now not working.
@tool-rules ,
1) recent changes: update edge module from 1.1 to 1.17, update webform from 5.1 to 5.22, core update 8.7.1 to 8.9.7 to 8.9.10 2) I would expect reverting to earlier backup would work, but that would remove security updates, etc?
composer.json
{
"name": "drupal/drupal",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"type": "project",
"license": "GPL-2.0-or-later",
"require": {
"drupal/core": "8.9.10",
"composer/installers": "^1.0.24",
"wikimedia/composer-merge-plugin": "^1.4",
"drupal/basic": "^2.0",
"drupal/console": "~1.0",
"drupal/devel": "^1.2",
"drupal/kint": "^1.2",
"drupal/video_embed_field": "^2.0",
"drupal/slick": "^1.0",
"drupal/address": "~1.0",
"drupal/superfish": "^1.2",
"cweagans/composer-patches": "^1.6",
"drupal/entityqueue": "^1.0@alpha",
"drupal/sharethis": "^2.0@beta",
"drupal/rules": "^3.0@alpha",
"drupal/jsonapi": "*",
"drupal/admin_toolbar": "2.4",
"symfony/http-foundation": "3.4.35",
"drupal/entity_reference_revisions": "^1.6",
"drupal/paragraphs": "^1.5",
"drupal/select2": "1.1.0",
"drupal/legal": "^1.0",
"drupal/block_field": "^1.0",
"drupal/module_filter": "^3.0",
"drupal/better_exposed_filters": "^3.0",
"drupal/fontawesome": "2.12",
"drupal/menu_export": "1.2",
"drupal/simplesamlphp_auth": "3.0",
"drupal/views_accordion": "1.2",
"drupal/webform": "5.22",
"drupal/fixed_block_content": "^1.0",
"drupal/styleguide": "1.0.0-alpha3",
"drupal/toc_filter": "^2.0",
"drupal/ctools": "3.0",
"drupal/panels": "4.4",
"drupal/pathauto": "^1.6",
"drupal/slick_extras": "1.0-rc2",
"drupal/brightcove": "1.3.0",
"drupal/elasticsearch_connector": "^6.0",
"drupal/devel_entity_updates": "1.0.0-rc2",
"drupal/google_analytics": "^2.4",
"drupal/google_tag": "^1.1",
"drupal/health_check": "^1.1",
"drupal/smtp": "1.0.0-beta4",
"drupal/tealiumiq": "^1.0",
"drupal/group": "1.0-rc5",
"drupal/apigee_edge": "1.17",
"drupal/search_api": "^1.18"
},
"require-dev": {
"drush/drush": "^9.6"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"preferred-install": "dist",
"autoloader-suffix": "Drupal8",
"component-dir": "vendor/",
"secure-http": false,
"platform": {
"php": "7.1"
}
},
"extra": {
"_readme": [
"By default Drupal loads the autoloader from ./vendor/autoload.php.",
"To change the autoloader you can edit ./autoload.php.",
"This file specifies the packages.drupal.org repository.",
"You can read more about this composer repository at:",
"https://www.drupal.org/node/2718229"
],
"merge-plugin": {
"include": [
"core/composer.json"
],
"recurse": true,
"replace": false,
"merge-extra": false
},
"installer-paths": {
"web/core": ["type:drupal-core"],
"web/modules/contrib/{$name}": ["type:drupal-module"],
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
"web/themes/contrib/{$name}": ["type:drupal-theme"],
"web/modules/custom/{$name}": ["type:drupal-custom-module"],
"web/themes/custom/{$name}": ["type:drupal-custom-theme"],
"web/libraries/{$name}": ["type:drupal-library"]
},
"enable-patching": false,
"patches": {
"drupal/simplesamlphp_auth": {
"Allow the module to be installed even if SimpleSAMLphp is not available": "https://www.drupal.org/files/issues/2019-02-13/simplesamlphp_auth-fatal-error-on-enable-2915568-31.patch",
"Don't attempt username sync when user was already matched by username": "https://www.drupal.org/files/issues/2018-05-03/2748731-12.patch",
"Role assignment from attributes does not work when provisioning accounts": "https://www.drupal.org/files/issues/2018-05-09/simplesamlphp_auth-role_assignment-2894945-4.patch"
},
"drupal/externalauth": {
"Make provider prefix to username optional": "https://www.drupal.org/files/issues/2018-04-19/externalauth-optional_prefix-2798323-24.patch"
},
"drupal/core": {
"Support entities that are neither content nor config entities": "https://www.drupal.org/files/issues/2019-05-08/jsonapi-support-all-fieldable-entity-types-3042467-21.patch"
},
"drupal/legal": {
"Don't logout the user after logging in": "https://www.drupal.org/files/issues/2019-03-13/legal-fix-flow-D8-2897486-6.patch"
},
"drupal/entityqueue": {
"Adds a check for null in the entityqueue access check": "https://www.drupal.org/files/issues/2019-06-02/handle-null-in-access-check.patch"
},
"brightcove/api": {
"Allows managing of TLS truststore on this service": "patches/brightcove_api/provide-dev-tls-support.patch"
},
"drupal/elasticsearch_connector": {
"Failed to parse node status": "https://www.drupal.org/files/issues/2018-06-07/elasticsearch_connector-convert_boolean_fields-2978005-2.patch"
}
}
},
"autoload": {
"psr-4": {
"Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
},
"files": ["web/private/SetSAMLEnvironmentVariables.php"]
},
"scripts": {
"pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
"post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess",
"post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
"post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
"drupal-phpunit-upgrade-check": "Drupal\\Core\\Composer\\Composer::upgradePHPUnit",
"drupal-phpunit-upgrade": "@composer update phpunit/phpunit --with-dependencies --no-progress",
"phpcs": "phpcs --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --",
"phpcbf": "phpcbf --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --"
},
"repositories": [{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "package",
"package": {
"name": "woothemes/flexslider",
"version": "2.6.3",
"type": "drupal-library",
"source": {
"url": "https://github.com/woothemes/FlexSlider.git",
"type": "git",
"reference": "2.6.3"
}
}
}
]
}
view after attempting to add user
When we revert to this setup, the function works again:
{
"name": "drupal/drupal",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"type": "project",
"license": "GPL-2.0-or-later",
"require": {
"drupal/core": "8.9.7",
"composer/installers": "^1.0.24",
"wikimedia/composer-merge-plugin": "^1.4",
"drupal/basic": "^2.0",
"drupal/console": "~1.0",
"drupal/devel": "^1.2",
"drupal/kint": "^1.2",
"drupal/video_embed_field": "^2.0",
"drupal/slick": "^1.0",
"drupal/address": "~1.0",
"drupal/superfish": "^1.2",
"cweagans/composer-patches": "^1.6",
"drupal/entityqueue": "^1.0@alpha",
"drupal/sharethis": "^2.0@beta",
"drupal/rules": "^3.0@alpha",
"drupal/jsonapi": "*",
"drupal/admin_toolbar": "2.4",
"symfony/http-foundation": "3.4.35",
"drupal/entity_reference_revisions": "^1.6",
"drupal/paragraphs": "^1.5",
"drupal/select2": "1.1.0",
"drupal/legal": "^1.0",
"drupal/block_field": "^1.0",
"drupal/module_filter": "^3.0",
"drupal/better_exposed_filters": "^3.0",
"drupal/fontawesome": "2.12",
"drupal/menu_export": "1.2",
"drupal/simplesamlphp_auth": "3.0",
"drupal/views_accordion": "1.2",
"drupal/webform": "5.22",
"drupal/fixed_block_content": "^1.0",
"drupal/styleguide": "1.0.0-alpha3",
"drupal/toc_filter": "^2.0",
"drupal/ctools": "3.0",
"drupal/panels": "4.4",
"drupal/pathauto": "^1.6",
"drupal/slick_extras": "1.0-rc2",
"drupal/brightcove": "1.3.0",
"drupal/elasticsearch_connector": "^6.0",
"drupal/devel_entity_updates": "1.0.0-rc2",
"drupal/google_analytics": "^2.4",
"drupal/google_tag": "^1.1",
"drupal/health_check": "^1.1",
"drupal/smtp": "1.0.0-beta4",
"drupal/tealiumiq": "^1.0",
"drupal/group": "1.0-rc5",
"drupal/apigee_edge": "1.10",
"drupal/search_api": "^1.18"
},
"require-dev": {
"drush/drush": "^9.6"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"preferred-install": "dist",
"autoloader-suffix": "Drupal8",
"component-dir": "vendor/",
"secure-http": false,
"platform": {
"php": "7.1"
}
},
"extra": {
"_readme": [
"By default Drupal loads the autoloader from ./vendor/autoload.php.",
"To change the autoloader you can edit ./autoload.php.",
"This file specifies the packages.drupal.org repository.",
"You can read more about this composer repository at:",
"https://www.drupal.org/node/2718229"
],
"merge-plugin": {
"include": [
"core/composer.json"
],
"recurse": true,
"replace": false,
"merge-extra": false
},
"installer-paths": {
"web/core": ["type:drupal-core"],
"web/modules/contrib/{$name}": ["type:drupal-module"],
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
"web/themes/contrib/{$name}": ["type:drupal-theme"],
"web/modules/custom/{$name}": ["type:drupal-custom-module"],
"web/themes/custom/{$name}": ["type:drupal-custom-theme"],
"web/libraries/{$name}": ["type:drupal-library"]
},
"enable-patching": false,
"patches": {
"drupal/simplesamlphp_auth": {
"Allow the module to be installed even if SimpleSAMLphp is not available": "https://www.drupal.org/files/issues/2019-02-13/simplesamlphp_auth-fatal-error-on-enable-2915568-31.patch",
"Don't attempt username sync when user was already matched by username": "https://www.drupal.org/files/issues/2018-05-03/2748731-12.patch",
"Role assignment from attributes does not work when provisioning accounts": "https://www.drupal.org/files/issues/2018-05-09/simplesamlphp_auth-role_assignment-2894945-4.patch"
},
"drupal/externalauth": {
"Make provider prefix to username optional": "https://www.drupal.org/files/issues/2018-04-19/externalauth-optional_prefix-2798323-24.patch"
},
"drupal/core": {
"Support entities that are neither content nor config entities": "https://www.drupal.org/files/issues/2019-05-08/jsonapi-support-all-fieldable-entity-types-3042467-21.patch"
},
"drupal/legal": {
"Don't logout the user after logging in": "https://www.drupal.org/files/issues/2019-03-13/legal-fix-flow-D8-2897486-6.patch"
},
"drupal/entityqueue": {
"Adds a check for null in the entityqueue access check": "https://www.drupal.org/files/issues/2019-06-02/handle-null-in-access-check.patch"
},
"brightcove/api": {
"Allows managing of TLS truststore on this service": "patches/brightcove_api/provide-dev-tls-support.patch"
},
"drupal/elasticsearch_connector": {
"Failed to parse node status": "https://www.drupal.org/files/issues/2018-06-07/elasticsearch_connector-convert_boolean_fields-2978005-2.patch"
}
}
},
"autoload": {
"psr-4": {
"Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
},
"files": ["web/private/SetSAMLEnvironmentVariables.php"]
},
"scripts": {
"pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
"post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess",
"post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
"post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
"drupal-phpunit-upgrade-check": "Drupal\\Core\\Composer\\Composer::upgradePHPUnit",
"drupal-phpunit-upgrade": "@composer update phpunit/phpunit --with-dependencies --no-progress",
"phpcs": "phpcs --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --",
"phpcbf": "phpcbf --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --"
},
"repositories": [{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "package",
"package": {
"name": "woothemes/flexslider",
"version": "2.6.3",
"type": "drupal-library",
"source": {
"url": "https://github.com/woothemes/FlexSlider.git",
"type": "git",
"reference": "2.6.3"
}
}
}
]
}
@phdhiren it seems when we update edge module from 1.1x to 1.12, invite/add member function breaks.
Hello, we'd like to update edge module to >= 1.12 as you have marked 1.12 as resolving security concern. Apigee support ticket informs us we must use github reporting to request assistance with this. Is someone available to review why we are unable to update past 1.11?
@tool-rules , Can you turn on debugging - To collect the request/responses going to Apigee, have them give us those logs. We can then use that info to see what data is being passed in that causes this issue. At the same time, I'm also trying to replicate the issue with above mentioned version
@tool-rules , Can you turn on debugging - To collect the request/responses going to Apigee, have them give us those logs. We can then use that info to see what data is being passed in that causes this issue. At the same time, I'm also trying to replicate the issue with above mentioned version
Our installation is on premises. Which logs are needed, and where would we securely send to?
Our module's documentation explains how monitor Apigee API debug logs. If you can pull out the API call/responses that happen after replicating issue, we can see why this issue is happening. If there is any sensitive info, you can modify/sanitize it before posting it. You can also send it directly to me, my email is on my profile page. However, you should still sanitize any data before sending to me. We don't need the actual private data, you can change all personally identifiable information to other values, and strip out any internal IPs/URLs.
@tool-rules , With the release 1.12 team member autocomplete is removed. You need to add full email address comma separated in case of multiple. From log seems the developers variable is coming blank or single.
@phdhiren I'd be happy to send you a video of what is being entered - I cannot post it as there would be no way to sanitize.
Feel free to share it w/me, my email is in my profile. I can then share it w/the team.
If you have an Apigee support account, you can also share information through a ticket opened there, and it can get to us also.
@tool-rules @phdhiren an error is being thrown in the validateForm()
method:
Warning: explode() expects parameter 2 to be string, array given in Drupal\apigee_edge_teams\Form\AddTeamMembersForm->validateForm() (line 181 of .../apigee_edge/modules/apigee_edge_teams/src/Form/AddTeamMembersForm.php)
On line 181 in AddTeamMembersForm
the call $form_state->getValue('developers', '')
is returning an array instead of a string which causes explode()
to fail, which causes the $emails
array to be null: https://github.com/apigee/apigee-edge-drupal/blob/0d88019a0f6e2994005cecbfce8d1f50471429d1/modules/apigee_edge_teams/src/Form/AddTeamMembersForm.php#L181
We should check for the case where $form_state->getValue('developers', '')
comes back as an array and handle it by appending the array together with a space so that explode() can handle the input as a string, and throw an error in the logs showing the $form_state->getValue('developers', '')
array values so that we can understand what input is coming in. I have no idea how an array is getting returned however.
Once we have the PR, @phdhiren can give you info on how to get the PR on a local instance for validation.
@tool-rules,
We need few more checks here:
Once you give us this information, hopefully we can find more details. Thank you for your patience and help in providing the requested information so far.
@phdhiren - here is the name:
<input data-drupal-selector="edit-developers" aria-describedby="edit-developers--description" type="email" id="edit-developers" name="developers" value="" size="60" maxlength="254" class="form-email required" required="required" aria-required="true">
@tool-rules ,
Is there any custom code which alters from the default textarea to textbox? Did you checked for point 1 and 3?
We checked on number 1 and 3. changing #1 to a default/basic theme made no change For number 3, grepping code we see nothing referring to textbox.
This is the custom code we found which touches on adding member to organization:
function devportal_organization_form_apigee_edge_teams_add_team_member_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
// Avoid doing an autocomplete and instead look for users by email AFTER submission.
$form['developers']['#title'] = t('Developer Email');
$form['developers']['#description'] = t('Enter the email of an existing developer to add them to the Organization.');
$form['developers']['#type'] = 'email';
$form['developers']['#element_validate'][] = 'devportal_organization_form_apigee_edge_teams_add_team_member_form_alter_validatie_email';
@phdhiren you are working on tasks in https://github.com/apigee/apigee-edge-drupal/issues/548#issuecomment-769472262 correct?
@tool-rules did you try disabling custom modules on a test instance to see if it change behavior?
@tool-rules ,
If you can disable this form_alter function on test environment and check especially last two line #element_validate and #type Probably the function 'devportal_organization_form_apigee_edge_teams_add_team_member_form_alter_validatie_email' is changing the data.
With the release 8.x-1.12 autocomplete of email is removed which seems to be purpose of this custom function per comment.
when we comment out:
function devportal_organization_form_apigee_edge_teams_add_team_member_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
// Avoid doing an autocomplete and instead look for users by email AFTER submission.
$form['developers']['#title'] = t('Developer Email');
$form['developers']['#description'] = t('Enter the email of an existing developer to add them to the Organization.');
// $form['developers']['#type'] = 'email';
// $form['developers']['#element_validate'][] = 'devportal_organization_form_apigee_edge_teams_add_team_member_form_alter_validatie_email';
it restores function. Was that your suggestion?
@tool-rules , Yes, this was the suggestion. Did that resolve your issue?
@phdhiren, yes this resolves our issue. Thank you for your time.
Thanks @phdhiren , glad we figured it out.
I thought about this a bit more, and opened a separate ticket to decide if we want to handle this situation in a way that will make it more clear if this situation arises again by someone adding custom changes: #554
Hello - When I try to invite/add member to team, it fails with the messages below. What do I need to do to resolve this problem?
1)
2)
3)
4)
5)
6)
7)
8)
9)
10)
11)
12)