The SharePoint Connector module gives Drupal users the ability to easily sync their Drupal content to their SharePoint lists. It provides backend interfaces to dynamically display all content types and webforms and their fields in order to allow a fine-grain mapping of Drupal data to different SharePoint columns and lists. Intended for use on Drupal 10 but also works on Drupal 8 and 9.
Project Link
Issue fork projectapplications-3393351
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
Comment #2
robbymo commentedComment #3
avpadernoThank you for applying!
Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.
The important notes are the following.
phpcs --standard=Drupal,>DrupalPracticeon the project, which alone fixes most of what reviewers would report.To the reviewers
Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.
The important notes are the following.
For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.
Comment #4
avpadernosharepoint_connector.info.yml
core_version_requirement: ^8 || ^9 || ^10Drupal releases before Drupal 8.7.7 do not recognize the
core_version_requirementproperty. The minimum Drupal 8 version needs to be indicated by^8.8.src/Controller/SharepointController.php
Dependencies must be injected with the DI container.
To log exceptions, there is the
watchdog_exception()function, or the OO code that function uses.src/Controller/SharepointControllerTabs.php
That property is already defined from the parent class. There is no need to redefine it.
The documentation comment for constructors is not mandatory anymore, If it is given, the description must be Constructs a new [class name] object. where [class name] includes the class namespace.
There is no need to use that code, when the method of a form class can be directly used in a route definition.
src/Form/SharepointConnectorForm.php
That property is not used from the class.
$sharepoint_config = $this->configFactory->get('sharepoint_connector.settings');Classes that extend
ConfigFormBaseuse$this->config()to get a configuration object.src/SharepointConnector.php
Either it is a
GuzzleHttp\Clientobject or a string.That class should rather be used for a service.
sharepoint_connector.module
The first argument for the logger methods that log a message must be a literal string, not a string concatenation.
Comment #5
robbymo commentedThank you for the feedback. These items have all been updated in the 1.0.x-dev branch.
Comment #6
andrei.vesterliHi @RobbyMo
I love this module a lot and bit thx for your contribution to the Drupal world! Here are some comments I will leave related to your solution.
_sharepoint_connector_process_node_fields,_sharepoint_connector_get_field_value,_sharepoint_connector_get_disabled_apiinto the service somewhere. If there is logic from the SharePoint connector, it's better to keep it within the serviceDrupal\webform\WebformSubmissionInterfacein the .module file which means, you use the webform module as a dependency. Please, add this dependency in the .info.yml filecomposer.jsonfile. You need it in order to set a requirement for the PHP version and also the required dependencies, for instance, to requiredrupal/webformsharepoint_connector.settings, you need to add the default config into the config/install/*. Also, add the schema definition too. Same for the otherssharepoint_connector_settings_types_form,sharepoint_connector_settings_form_fields,sharepoint_connector_settings_form_webform_fields,sharepoint_connector_settings_webforms_formSharepointConnectorand you can also add those mentioned functions from the .mnodule file here. As a recommendation please, add the interface definition for it.Comment #7
andrei.vesterliComment #8
robbymo commentedThank you for the feedback. These items have all been addressed in the 1.0.x-dev branch.
Comment #9
robbymo commentedComment #10
avpadernosrc/Form/SharepointConnectorForm.php
Why is the form ID added to each form element name? Inside the form, those form element names are already unique.
$form_state->getValue()does not return values for fieldsets. (Fieldsets are render elements, not form elements. They cannot be used to submit values.)You need to call
$form_state->getValue()for each of the form elements.Form element descriptions must be translatable strings. That is valid also for strings added to existing descriptions.
src/Form/SharepointConnectorFormContentTypes.php
SharepointConnectorFormContentTypesdoes not have anysubmitForm()method, which means no value will be saved. If the purpose of the class is only showing values or links, it should not extendConfigFormBase.src/Access/WebformModuleCheck.php
Methods defined in a parent class or in an interface just need
{@inheritDoc}as documentation comment.A few notes more:
Comment #11
robbymo commentedThank you for the feedback. These items have all been addressed in the 1.0.x-dev branch. I noticed phpcs flagged the constructor short descriptions for being longer than 80 characters due to the class namespaces but from https://www.drupal.org/docs/develop/standards/php/php-coding-standards it mentions "Lines containing longer function names, function/class definitions, variable declarations, etc are allowed to exceed 80 characters." so I assume that it's fine. Please let me know if there are any issues.
Comment #12
vishal.kadamComment #13
avpadernoYes, the limit of 80 characters is not strict on those cases, especially when the full (namespaced) class name is expected.
Comment #14
alvar0hurtad0I see this as a security issue:
https://git.drupalcode.org/project/sharepoint_connector/-/blob/1.0.x/src...
In my eyes we should compliment with a permission or provide a neutral result in order to allow other existing permissions to return a forbidden if the user should not access to the route. Also the webform module is a dependency in in the info.yml file, so it seems like this access check is always true.
Comment #15
robbymo commentedThank you for the feedback. This item has been removed in the 1.0.x-dev branch as it is no longer necessary as the webform module is now a dependency as you mentioned. I will be looking to make this optional again in the near future and will incorporate in your suggestions. For my education would you be able to elaborate on why this is considered a security issue?
Also do you know at what point the module is deemed RTBC? Is it time based (X days without someone finding an issue) or does someone specific needs to do a specific validation or is there different criteria? Just wondering since we're looking to add in additional functionality but per the submission guidelines until this gets approved I am the only one who can make code updates to the project. Thanks!
Comment #16
robbymo commentedComment #17
avpadernoThank you for your contribution!
I updated your account so you can now opt into security advisory coverage for any project you created and every project you will create.
These are some recommended readings to help you with maintainership:
You can find more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved!
Thank you for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank also the dedicated reviewers as well.
Comment #18
avpaderno