Skip to content

Fix the sharable link#313

Merged
pokhiii merged 9 commits intodevelopfrom
fix-the-sharable-link
Oct 2, 2024
Merged

Fix the sharable link#313
pokhiii merged 9 commits intodevelopfrom
fix-the-sharable-link

Conversation

@tarunnjoshi
Copy link
Copy Markdown
Member

@tarunnjoshi tarunnjoshi commented Oct 2, 2024

Fix the sharable link

Summary by CodeRabbit

  • New Features

    • Enhanced URL paths for 'Vehicle Dispatch' and 'Camp Outcome' links, now including additional parameters for improved data accuracy.
    • Improved QR code generation with error handling and logging.
    • Added functionality for better address handling in event records.
  • Bug Fixes

    • Corrected URL formatting by removing unnecessary prefixes, ensuring links function as intended.
  • Refactor

    • Minor formatting update in the method signature for improved readability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 2, 2024

Walkthrough

The changes involve modifications to the CRM_Goonjcustom_Form_CollectionCampLinks class, specifically the generateLinks method. The updates include adding new parameters to the URL construction for the links generated, enhancing the detail of the 'Vehicle Dispatch' and 'Camp Outcome' links. Additionally, the CollectionCampService class has been updated to refine event handling, address processing, QR code generation, and email notifications. A new variable has been added in the civicrm_api3_goonjcustom_collection_camp_cron function to improve URL construction for notifications.

Changes

File Path Change Summary
wp-content/civi-extensions/goonjcustom/CRM/Goonjcustom/Form/CollectionCampLinks.php Updated generateLinks method to include new parameters in URL construction and added use Civi\Api4\EckEntity;. Minor formatting change in method signature.
wp-content/civi-extensions/goonjcustom/Civi/CollectionCampService.php Refined event handling methods, enhanced QR code generation with error handling, and updated email notification parameters.
wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/CollectionCampCron.php Added new variable $initiatorId in civicrm_api3_goonjcustom_collection_camp_cron function for improved URL construction.

Possibly related PRs

  • Updated Mail Id for Collection Camp #300: The changes in this PR involve modifications to the civicrm_api3_goonjcustom_collection_camp_cron function, which is also related to the URL construction for collection camp notifications, similar to the updates made in the generateLinks method of the main PR.
  • Remove the filled by option for ACK form #301: This PR modifies the goonjcustom_material_management_email_html method in the CollectionCampService class, which is directly related to the changes in the generateLinks method that also involve email notifications and URL parameters.
  • Refactor: Store entity ID in Eck_Collection_Camp1 in directive #307: The changes in this PR involve the CollectionCampService class, which is relevant as it deals with the management of collection camp functionalities, similar to the updates in the main PR regarding URL generation for camp links.
  • Seperate the cron for feedback and logistics #309: This PR modifies the civicrm_api3_goonjcustom_collection_camp_cron function, which is related to the main PR's focus on enhancing URL generation for collection camp links, indicating a connection in functionality.
  • Fix/redirection for new individual signup for pu visit #311: The changes in this PR involve the CollectionCampService class, which is relevant as it deals with the management of collection camp functionalities, similar to the updates in the main PR regarding URL generation for camp links.

Suggested reviewers

  • pokhiii

Poem

In the land of code where rabbits hop,
New links are born, and we won't stop.
With campAddress and campCode in tow,
Our URLs shine, watch them glow!
Hooray for changes, let's give a cheer,
For better links, we hold so dear! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
wp-content/civi-extensions/goonjcustom/CRM/Goonjcustom/Form/CollectionCampLinks.php (1)

81-85: Summary: URL path updates align with PR objective

The changes made to the generateLinks method focus on updating the URL paths used in the createUrl method calls. These modifications align with the PR objective of fixing the sharable link by removing the 'civicrm/' prefix from the paths.

Key points:

  1. The changes are consistent across both affected URLs.
  2. The modification suggests an update in the routing structure of the CiviCRM system.
  3. No other parts of the file were altered, maintaining the existing functionality.

To ensure a smooth transition and maintain system integrity:

  1. Update any documentation that references these URLs to reflect the new structure.
  2. If this change is part of a larger routing structure update, ensure all related components (e.g., menu items, permissions, etc.) are updated accordingly.
  3. Consider adding a comment in the code explaining the reason for this URL structure change to provide context for future developers.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 32f28a6 and 3063cbb.

📒 Files selected for processing (1)
  • wp-content/civi-extensions/goonjcustom/CRM/Goonjcustom/Form/CollectionCampLinks.php (1 hunks)
🔇 Additional comments (1)
wp-content/civi-extensions/goonjcustom/CRM/Goonjcustom/Form/CollectionCampLinks.php (1)

81-81: LGTM! Verify the new URL structure.

The changes to remove the 'civicrm/' prefix from the URL paths appear to be consistent and aligned with the PR objective of fixing the sharable link. This modification suggests an update in the routing structure.

To ensure the new URL structure is correct, please run the following verification:

Ensure that:

  1. There are no remaining references to the old URL structure with 'civicrm/' prefix.
  2. The new URL paths ('/camp-vehicle-dispatch-form' and '/camp-outcome-form') are properly defined in your routing configuration.

If any inconsistencies are found, please update the relevant routing configuration files accordingly.

Also applies to: 85-85

✅ Verification successful

Verified the updated URL structure.

All references to the old URL structure have been removed, and the new URL paths are correctly defined in the routing configuration.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the routing configuration for the modified URLs

# Test 1: Check if there are any remaining references to the old URL structure
echo "Checking for any remaining references to old URL structure:"
rg --type php 'civicrm/camp-vehicle-dispatch-form|civicrm/camp-outcome-form'

# Test 2: Verify the existence of route definitions for the new URL structure
echo "Verifying route definitions for new URL structure:"
rg --type php '/camp-vehicle-dispatch-form|/camp-outcome-form'

# Note: Adjust the search patterns if necessary based on your routing configuration files

Length of output: 1148

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
wp-content/civi-extensions/goonjcustom/CRM/Goonjcustom/Form/CollectionCampLinks.php (2)

83-89: LGTM: Additional data retrieval for link generation

The addition of EckEntity::get() to fetch 'Location_Area_of_camp' and 'title' fields enhances the link generation process by including more specific information.

However, consider adding error handling for cases where the execute()->single() call might not return a result or return multiple results unexpectedly.

Consider adding a try-catch block or a null check:

try {
    $collectionCamp = EckEntity::get('Collection_Camp', TRUE)
      ->addSelect('Collection_Camp_Intent_Details.Location_Area_of_camp', 'title')
      ->addWhere('id', '=', $this->_collectionCampId)
      ->execute()->single();

    if (empty($collectionCamp)) {
        throw new \Exception("No Collection Camp found with id {$this->_collectionCampId}");
    }

    $campAddress = $collectionCamp['Collection_Camp_Intent_Details.Location_Area_of_camp'];
    $campCode = $collectionCamp['title'];
} catch (\Exception $e) {
    \Civi::log()->error('Error retrieving Collection Camp data: ' . $e->getMessage());
    // Handle the error appropriately, e.g., set default values or return early
}

93-108: LGTM: Enhanced URL parameters for links

The addition of new parameters to the 'Vehicle Dispatch' and 'Camp Outcome' links improves the specificity and informativeness of these links. The use of $campCode and $campAddress is consistent with the earlier data retrieval.

Consider URL-encoding the parameter values to ensure they are properly formatted for use in a URL.

Consider using urlencode() for the parameter values:

'url' => self::createUrl(
    '/camp-vehicle-dispatch-form',
    "Camp_Vehicle_Dispatch.Collection_Camp_Intent_Id={$this->_collectionCampId}&Camp_Vehicle_Dispatch.To_which_PU_Center_material_is_being_sent={$this->_processingCenterId}&Camp_Vehicle_Dispatch.Filled_by={$contactId}&Camp_Vehicle_Dispatch.Collection_Camp_Code=" . urlencode($campCode) . "&Camp_Vehicle_Dispatch.Collection_Camp_Address=" . urlencode($campAddress),
    $contactId
),

This ensures that any special characters in $campCode or $campAddress are properly encoded for use in a URL.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6da311f and 29bb186.

📒 Files selected for processing (1)
  • wp-content/civi-extensions/goonjcustom/CRM/Goonjcustom/Form/CollectionCampLinks.php (2 hunks)
🔇 Additional comments (3)
wp-content/civi-extensions/goonjcustom/CRM/Goonjcustom/Form/CollectionCampLinks.php (3)

14-14: LGTM: EckEntity import added

The addition of use Civi\Api4\EckEntity; is appropriate and consistent with its usage in the generateLinks method.


80-80: LGTM: Improved method signature formatting

The addition of a space before the return type declaration in public function generateLinks($contactId): void improves readability and aligns with PSR-12 coding standards.


Line range hint 1-208: Overall assessment: Improvements to link generation process

The changes in this file enhance the link generation process for Collection Camp related actions. The addition of the EckEntity API usage allows for more specific information to be included in the generated links. The code is well-structured and the changes are consistent throughout the file.

Consider implementing the suggested improvements for error handling in the data retrieval process and URL encoding of parameter values to further enhance the robustness of the code.

@tarunnjoshi tarunnjoshi self-assigned this Oct 2, 2024
@tarunnjoshi tarunnjoshi requested a review from pokhiii October 2, 2024 12:32
@tarunnjoshi tarunnjoshi force-pushed the fix-the-sharable-link branch from 0d988e7 to bb1d86e Compare October 2, 2024 12:45
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (3)
wp-content/civi-extensions/goonjcustom/CRM/Goonjcustom/Form/CollectionCampLinks.php (1)

74-93: Summary of changes and recommendations

The changes to the generateLinks method appear to address the PR objective of fixing the sharable link by adding more context to the generated URLs. However, there are a few points that need attention:

  1. The duplication of $this->_collectionCampId in the 'Vehicle Dispatch' link parameters should be reviewed and potentially simplified.
  2. Input validation and sanitization should be implemented for all variables used in URL generation to prevent potential security vulnerabilities.
  3. A brief comment explaining the purpose of the new parameters (Camp_Vehicle_Dispatch.Filled_by and Camp_Outcome.Filled_By) would improve code clarity.

Please address these points to enhance the security and maintainability of the code.

wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/CollectionCampCron.php (1)

Line range hint 1-158: Summary of changes and final considerations

The changes in this file focus on two main areas:

  1. Improving data accuracy by fetching the initiator ID separately for each collection camp.
  2. Modifying the sharable link construction for the camp vehicle dispatch form.

These changes align with the PR objective of fixing the sharable link and previous learnings about data fetching. The overall structure and functionality of the cron job remain intact.

Final considerations:

  1. Ensure that the removal of parameters from $campVehicleDispatchFormUrl doesn't break any existing functionality.
  2. Consider whether similar changes are needed for $campOutcomeFormUrl to maintain consistency.
  3. If not already done, add appropriate error handling for cases where $initiatorId might be empty or invalid.
wp-content/civi-extensions/goonjcustom/Civi/CollectionCampService.php (1)

Line range hint 996-1006: Sanitize variables to prevent Cross-Site Scripting (XSS) vulnerabilities.

The variables $campCode, $campAddress, and $materialdispatchUrl are directly embedded into the HTML output without proper sanitization or escaping. This could lead to XSS vulnerabilities if these variables contain malicious content. It's crucial to sanitize and escape all user-supplied data before outputting it in HTML contexts.

Apply this diff to fix the issue:

         $homeUrl = \CRM_Utils_System::baseCMSURL();
-        $materialdispatchUrl = $homeUrl . 'acknowledgement-form-for-logistics/#?Eck_Collection_Source_Vehicle_Dispatch1=' . $vehicleDispatchId . '&Camp_Vehicle_Dispatch.Collection_Camp_Intent_Id=' . $collectionCampId . '&id=' . $vehicleDispatchId . '&Eck_Collection_Camp1=' . $collectionCampId;
-        $html = "
-        <p>Dear MMT team,</p>
-        <p>This is to inform you that a vehicle has been sent from camp <strong>$campCode</strong> at <strong>$campAddress</strong>.</p>
-        <p>Kindly acknowledge the details by clicking on this form <a href=\"$materialdispatchUrl\"> Link </a> when it is received at the center.</p>
-        <p>Warm regards,<br>Urban Relations Team</p>";
+        $materialdispatchUrl = $homeUrl . 'acknowledgement-form-for-logistics/?' . http_build_query([
+            'Eck_Collection_Source_Vehicle_Dispatch1' => $vehicleDispatchId,
+            'Camp_Vehicle_Dispatch.Collection_Camp_Intent_Id' => $collectionCampId,
+            'id' => $vehicleDispatchId,
+            'Eck_Collection_Camp1' => $collectionCampId,
+        ]);
+        $html = "
+        <p>Dear MMT team,</p>
+        <p>This is to inform you that a vehicle has been sent from camp <strong>" . htmlspecialchars($campCode, ENT_QUOTES, 'UTF-8') . "</strong> at <strong>" . htmlspecialchars($campAddress, ENT_QUOTES, 'UTF-8') . "</strong>.</p>
+        <p>Kindly acknowledge the details by clicking on this form <a href=\"" . htmlspecialchars($materialdispatchUrl, ENT_QUOTES, 'UTF-8') . "\"> Link </a> when it is received at the center.</p>
+        <p>Warm regards,<br>Urban Relations Team</p>";
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 11826b6 and 15fd985.

📒 Files selected for processing (3)
  • wp-content/civi-extensions/goonjcustom/CRM/Goonjcustom/Form/CollectionCampLinks.php (1 hunks)
  • wp-content/civi-extensions/goonjcustom/Civi/CollectionCampService.php (1 hunks)
  • wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/CollectionCampCron.php (2 hunks)
🧰 Additional context used
📓 Learnings (1)
wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/CollectionCampCron.php (1)
Learnt from: tarunnjoshi
PR: ColoredCow/goonj#309
File: wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/VolunteerFeedbackCollectionCampCron.php:72-75
Timestamp: 2024-10-02T11:45:22.959Z
Learning: When fetching `initiatorId` and `campAddress` for each `collectionCampId` within a loop, it's necessary to retrieve them separately in each iteration rather than including them in the initial API call.
🔇 Additional comments (4)
wp-content/civi-extensions/goonjcustom/CRM/Goonjcustom/Form/CollectionCampLinks.php (2)

74-74: LGTM: Method signature formatting improvement

The addition of a space before the return type declaration aligns with PSR-12 coding standards, improving code readability.


78-93: 💡 Codebase verification

⚠️ Potential issue

Verification Summary

  • Vehicle Dispatch Link Parameters
    Both Collection_Camp_Intent_Id and Eck_Collection_Camp1 are used consistently across the codebase, indicating that both parameters are required.

  • Input Validation and Sanitization
    The current implementation uses variables directly in URL generation without validation, posing potential security risks.
    Action Required: Implement input validation and sanitization for $this->_collectionCampId, $this->_processingCenterId, and $contactId before using them in URLs.

  • Purpose of New Parameters
    Adding comments to explain the purpose of Camp_Vehicle_Dispatch.Filled_by and Camp_Outcome.Filled_By would enhance code clarity and maintainability.

🔗 Analysis chain

Review the 'Vehicle Dispatch' link parameters

The 'Vehicle Dispatch' link includes $this->_collectionCampId twice with different parameter names:

  1. Collection_Camp_Intent_Id={$this->_collectionCampId}
  2. Eck_Collection_Camp1={$this->_collectionCampId}

This duplication might be unnecessary. Please verify if both parameters are required, and if not, consider removing one of them.

Consider adding input validation and sanitization

The method uses several variables ($this->_collectionCampId, $this->_processingCenterId, $contactId) directly in the URL without any apparent validation or sanitization. This could potentially lead to security vulnerabilities if these variables contain malicious data.

Consider implementing input validation and sanitization for these variables before using them in the URL generation.

Clarify the purpose of new parameters

The changes introduce new parameters to both the 'Vehicle Dispatch' and 'Camp Outcome' links:

  • Camp_Vehicle_Dispatch.Filled_by={$contactId}
  • Camp_Outcome.Filled_By={$contactId}

While these additions seem to address the PR objective of fixing the sharable link, it would be helpful to have a brief comment explaining the purpose of these new parameters and how they contribute to fixing the issue.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usages of Collection_Camp_Intent_Id and Eck_Collection_Camp1 in the codebase
echo "Searching for Collection_Camp_Intent_Id usage:"
rg "Collection_Camp_Intent_Id" --type php
echo "\nSearching for Eck_Collection_Camp1 usage:"
rg "Eck_Collection_Camp1" --type php

Length of output: 3691


Script:

#!/bin/bash
# Search for usages of Camp_Vehicle_Dispatch.Filled_by and Camp_Outcome.Filled_By in the codebase
echo "Searching for Camp_Vehicle_Dispatch.Filled_by usage:"
rg "Camp_Vehicle_Dispatch\.Filled_by" --type php
echo "\nSearching for Camp_Outcome.Filled_By usage:"
rg "Camp_Outcome\.Filled_By" --type php

Length of output: 1519

wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/CollectionCampCron.php (1)

77-77: LGTM: Addition of $initiatorId improves code accuracy

The introduction of $initiatorId aligns with best practices for fetching data separately for each collection camp. This change ensures that the correct initiator is associated with each camp, improving the overall accuracy of the cron job.

wp-content/civi-extensions/goonjcustom/Civi/CollectionCampService.php (1)

996-996: ⚠️ Potential issue

Correct the URL construction to ensure query parameters are processed properly.

The URL is constructed using #? which may cause the query parameters to be part of the fragment identifier. This means they won't be sent to the server, potentially leading to incorrect behavior. Query parameters should be appended using ?, and the fragment identifier should follow after #.

Consider refactoring the URL construction as follows:

-        $materialdispatchUrl = $homeUrl . 'acknowledgement-form-for-logistics/#?Eck_Collection_Source_Vehicle_Dispatch1=' . $vehicleDispatchId . '&Camp_Vehicle_Dispatch.Collection_Camp_Intent_Id=' . $collectionCampId . '&id=' . $vehicleDispatchId . '&Eck_Collection_Camp1=' . $collectionCampId;
+        $queryParams = [
+            'Eck_Collection_Source_Vehicle_Dispatch1' => $vehicleDispatchId,
+            'Camp_Vehicle_Dispatch.Collection_Camp_Intent_Id' => $collectionCampId,
+            'id' => $vehicleDispatchId,
+            'Eck_Collection_Camp1' => $collectionCampId,
+        ];
+        $materialdispatchUrl = $homeUrl . 'acknowledgement-form-for-logistics/?' . http_build_query($queryParams);

This ensures the query parameters are correctly formatted and sent to the server.

$homeUrl = \CRM_Utils_System::baseCMSURL();
// Construct the full URLs for the forms.
$campVehicleDispatchFormUrl = $homeUrl . 'camp-vehicle-dispatch-form/#?Camp_Vehicle_Dispatch.Collection_Camp_Intent_Id=' . $collectionCampId . '&Camp_Vehicle_Dispatch.Filled_by=' . $campAttendedById . '&Camp_Vehicle_Dispatch.To_which_PU_Center_material_is_being_sent=' . $collectionCampGoonjOffice . '&Camp_Vehicle_Dispatch.Collection_Camp_Code=' . $campCode . '&Camp_Vehicle_Dispatch.Collection_Camp_Address=' . $campAddress;
$campVehicleDispatchFormUrl = $homeUrl . 'camp-vehicle-dispatch-form/#?Camp_Vehicle_Dispatch.Collection_Camp_Intent_Id=' . $collectionCampId . '&Camp_Vehicle_Dispatch.Filled_by=' . $campAttendedById . '&Camp_Vehicle_Dispatch.To_which_PU_Center_material_is_being_sent=' . $collectionCampGoonjOffice . '&Eck_Collection_Camp1=' . $collectionCampId;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Old URL parameters still in use

Found remaining references to old URL parameters which might affect the functionality of the form. Please address these to ensure the sharable link fix is complete.

  • wp-content/civi-extensions/goonjcustom/Civi/CollectionCampService.php
  • wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/CollectionCampCron.php
  • wp-content/civi-extensions/goonjcustom/CRM/Goonjcustom/Form/CollectionCampLinks.php
🔗 Analysis chain

Verify completeness of sharable link fix

The modification of $campVehicleDispatchFormUrl appears to address the PR objective of fixing the sharable link. The addition of the Eck_Collection_Camp1 parameter with $collectionCampId seems to be a more direct way of referencing the collection camp.

However, please verify:

  1. That the removal of previous parameters doesn't affect the form's functionality.
  2. That this change fully resolves the issue with the sharable link.
  3. Whether similar changes are needed for $campOutcomeFormUrl to maintain consistency.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to old URL parameters and verify consistency with campOutcomeFormUrl

# Test 1: Check for any remaining references to old URL parameters
echo "Checking for old URL parameters:"
rg "Camp_Vehicle_Dispatch\.Collection_Camp_Intent_Id|Camp_Vehicle_Dispatch\.Filled_by|Camp_Vehicle_Dispatch\.To_which_PU_Center_material_is_being_sent" --type php

# Test 2: Check if campOutcomeFormUrl uses similar parameter structure
echo "Checking campOutcomeFormUrl structure:"
rg "campOutcomeFormUrl.*Eck_Collection_Camp1" --type php

Length of output: 2250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants