Step to reproduce issue.
1. Create modal Called test- enter title body and in page section give path "/node/1".
2. visit "/node/1" page modal works well.
3. Edit test modal and now change path as "/abcd" in page section where "abcd" is path alias for "/node/1"
4. now visit "/abcd" or "/node/1" page modal will not show.

Comments

Hardik_Patel_12 created an issue. See original summary.

hardik_patel_12’s picture

Assigned: hardik_patel_12 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.69 KB
hardik_patel_12’s picture

Adding dependency in test file also

renatog’s picture

Interesting @hardik_patel_12

Very good!

We need to check the tests right?! The test was failed =/

hardik_patel_12’s picture

@RenatoG , yes test has 1 error, but i am not able to figure out why is getting failed can you help me here

renatog’s picture

Yes, of course.

Thalles created these tests but I didn't check it yet.

@thalles: please, can you help with this?

Rangaswini’s picture

Assigned: Unassigned » Rangaswini
Rangaswini’s picture

Hello, I have tested the patch and it works fine.

1. Inside ADVANCED option
On button click, if you want to redirect to internal or external URL then that URL needs to add in OK Button Redirect URL
field

a. External URL

b. Internal URL

2. After successfully done Add modal or Edit modal, will be able to see a pop-up

3. On button click, it will redirect to a link provided in advanced option.

Rangaswini’s picture

Assigned: Rangaswini » Unassigned
Status: Needs review » Reviewed & tested by the community
hardik_patel_12’s picture

Status: Reviewed & tested by the community » Needs review

Hello @Rangaswini ,
I think you have reviewed for different issues, kindly recheck.

Thankyou

renatog’s picture

Issue summary: View changes

Yeah. Makes sense.

This test is related to #3100534: Redirect after modal submit

The current issue we need to check the reason that the automated tests are failing.

Rangaswini’s picture

Assigned: Unassigned » Rangaswini

@hardik_patel_12 @RenatoG, Patch is not getting applied properly. Think so there may be some new changes got added.

abhisekmazumdar’s picture

Status: Needs review » Needs work

As per the above comments moving this issue.

Rangaswini’s picture

@hardik_patel_12 @RenatoG
Apologies for my comment #8
I have accidentally added a comment on this issue. and comment #8 is for https://www.drupal.org/project/modal_page/issues/3100534 issue.

renatog’s picture

Relax, no problems

Thank you all for your help

hardik_patel_12’s picture

As per comment no #12 , i will look into it. @Rangaswini thanks a lot for review.

hardik_patel_12’s picture

Status: Needs work » Needs review
StatusFileSize
new7.42 KB

Follow a new patch.

hardik_patel_12’s picture

Assigned: hardik_patel_12 » Unassigned
thalles’s picture

Follow a new patch and the interdiff.

There were some changes, so I ask you to check

Status: Needs review » Needs work

The last submitted patch, 19: modal_not_working_on_alias_page-3100182-18.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

thalles’s picture

Status: Needs work » Needs review
StatusFileSize
new7.77 KB
thalles’s picture

+++ b/src/ModalPage.php
@@ -208,7 +219,8 @@ class ModalPage {
-    $currentPath = ltrim($this->request->getRequestUri(), '/');
+    // $currentPath = ltrim($this->request->getRequestUri(), '/');
+    $currentPath = $this->request->getRequestUri();

This change broken the test.

+++ b/src/Form/ModalForm.php
@@ -130,6 +130,23 @@ class ModalForm extends ContentEntityForm {
+      if ($trim_url !== '<front>' && $trim_url[0] !== '/') {

And I change this line to allow the

abhisekmazumdar’s picture

StatusFileSize
new8.02 KB
new830 bytes

Thank You @thalles for the patch. Just an suggestion to follow the patch naming pattern.
Updated the patch with some coding standard fixes.

thalles’s picture

Status: Needs review » Fixed
renatog’s picture

Hello guys, congrats on the job! Amazing!

I saw a detail:

On this part $aliasPath[] = \Drupal::service('path.alias_manager')->getPathByAlias($path);

We can use dependency injection stead of \Drupal::service('path.alias_manager') that's right?

Example:

$this->pathAliasManager->getPathByAlias($path);

wil2091’s picture

Hey guys,
I noticed the line ->condition('pages', NULL, 'IS') removed from getModalIds() .
This is causing the modal not to show in all pages if the pages field is left blank.
Can this be added back?

thalles’s picture

Thanks @wil2091!
I will check this!

thalles’s picture

Status: Fixed » Needs work

  • thalles committed ddea2eb on 8.x-2.x
    Issue #3100182 by Hardik_Patel_12, thalles, abhisekmazumdar, Rangaswini...
thalles’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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

wil2091’s picture