Problem/Motivation

We saw at #3311657: Doesn't work for bootstrap Bario but works for admin theme that there is incompatibility with Bootstrap 5, we can work on this ticket

Steps to reproduce

Proposed resolution

Would be great if we can configure inside of settings if we can use bootstrap 3 (default) of 5 (new one)

Remaining tasks

User interface changes

API changes

Data model changes

Comments

RenatoG created an issue. See original summary.

viniciuscosta’s picture

Assigned: Unassigned » viniciuscosta

Hi, I'll work on it

viniciuscosta’s picture

Assigned: viniciuscosta » Unassigned
Status: Active » Needs review
StatusFileSize
new9.18 KB

Here's the patch for the issue, I ask gently for someone to review it.

juancec’s picture

Assigned: Unassigned » juancec

Hi, I'll review it.

juancec’s picture

Assigned: juancec » Unassigned
Status: Needs review » Needs work

Hi @viniciuscosta, I reviewed your patch and there are some issues which are the following:
- After creating or editing a modal, the layout of /admin/structure/modal is being bugged.
- The placeholders are not working when trying to do any modal config modification.
Hence moving it to NW. Thank you.

viniciuscosta’s picture

Assigned: Unassigned » viniciuscosta
viniciuscosta’s picture

Assigned: viniciuscosta » Unassigned
Status: Needs work » Needs review
StatusFileSize
new9.58 KB

I ask gently to review it again.

juancec’s picture

Assigned: Unassigned » juancec

I'll review it

juancec’s picture

Assigned: juancec » Unassigned
Status: Needs review » Needs work

Hey @viniciuscosta, I reviewed your patch and everything is almost working good. There are some placeholder bugs once you install the module with the patch applied. Here are the steps to reproduce the bugs:

1. Installed the module with your changes. (The placeholders are bugged).
2. I look at the modal config page and selected "Bootstrap 5". (The placeholders are bugged too).
3. I changed from "Bootstrap 5" to "Bootstrap 3". (The placeholders bugs fixed).

Hence I move the issue to NW. Thank you.

juancec’s picture

Assigned: Unassigned » juancec
viniciuscosta’s picture

Assigned: juancec » viniciuscosta
viniciuscosta’s picture

Assigned: viniciuscosta » Unassigned
Status: Needs work » Needs review
StatusFileSize
new9.66 KB

I ask gently to review it again.

juancec’s picture

Assigned: Unassigned » juancec

Hi. I'll review it.

juancec’s picture

Assigned: juancec » Unassigned
Status: Needs review » Reviewed & tested by the community

Hi @viniciuscosta, great work.

I reviewed the patch #12 and everything is working fine, but there is still a little bug when the "Bootstrap 5" option is selected in Modal Page Settings -> Select a version, this produces placeholder bugs in the whole CMS. I hope the mantainers can provide a feedback about how to fix this placeholder bugs.

Thank you =)

renatog’s picture

Thank you guys for your amazing job on this contribution

this produces placeholder bugs in the whole CMS

@juancec do you mind explaining better what's this "placeholder bugs in the whole CMS", please?

juancec’s picture

Hi @RenatoG, once "Bootstrap 5" is selected, the placeholder bugs appear in some /admin/* pages. The screenshots show some of the placeholder bugs.

renatog’s picture

StatusFileSize
new21.08 KB

That's this "gray rectangle" in the screenshot?

Was placed in an "image editor" like Photoshop or is a layout bug after selects "Bootstrap 5" in the configuration? 🤔

juancec’s picture

That's the bug I'm talking about when I select "Bootstrap 5".

renatog’s picture

Status: Reviewed & tested by the community » Needs work

That's the bug I'm talking about when I select "Bootstrap 5".

Got it. So I think we can move that to Needs Works because there is a probably to this "gray rectangle" appearing in another places that we didn't realize yet

I'd say that if it's very hard to fix and we don't find any solution for this I think we can analise if makes sense merge this current solution #3313638: Create Support to work with Bootstrap 5 and report this placeholder bug in a separated issue

viniciuscosta’s picture

I was looking for what is causing this problem, it is caused by a bootstrap 5 that adds some properties to this class "placeholder", I can set in the CSS a style to override this style from bootstrap 5, but I don't know if this is the correct way to solve this problem. @RenatoG, do you agree with that, or you think that must have to find another way?

renatog’s picture

@viniciuscosta @juancec , I was looking here and seems to be caused at this one: #3233533: Core .placeholder class conflicts with new Bootstrap .placeholder class

On this issue, in the comment #11 seems that there is an workaround

em.placeholder {
  display: unset;
  min-height: unset;
  vertical-align: unset;
  cursor: unset;
  background-color: unset;
  opacity: unset;
}

And in the Drupal project bootstrap5 it was fixed with that, look on this commit: https://git.drupalcode.org/project/bootstrap5/-/commit/670c44353a3a1b31c...

So, do you think we can try this same workaround?

If for any reason this workaround didn't work I think we can commit our issue to include the support to BS5 and explain that this issue with "placeholder" has the root cause at this issue

What do you think, makes sense for you?

viniciuscosta’s picture

Thanks for your help @RenatoG, I think we can go for this path, I will apply a patch with this workaround.

viniciuscosta’s picture

Status: Needs work » Needs review
StatusFileSize
new9.81 KB
juancec’s picture

Assigned: Unassigned » juancec

I'll review it.
Thank you @RenatoG for your help.

juancec’s picture

Assigned: juancec » Unassigned
Status: Needs review » Reviewed & tested by the community

Good job @viniciuscosta. I reviewed the patch #24, everything is working fine and the layout bugs have been fixed when select "Bootstrap 5" option. Hence I move the issue to RTBC. Thank you.

renatog’s picture

Awesome! Great job team!

I'll take a look and merge in the same plan of #3304464: Plan to Modal 5 (Drupal 10 Support)

Probably we'll merge first the #3288686: Automated Drupal 10 compatibility fixes and after that we'll merge this task in same version.

With that Modal 5 will supports D10 and BS5. Awesome

Thanks you so much everyone

renatog’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

I was going to merge this patch #24 but new fixes were commited into 4.1.x and was necessary to move these fixes to the new version 5.0.x

After merge 4.1.x into 5.0.x this patch #24 needs to be updated because some files were updated and can't be merged because of conflict

Now the branch 5.0.x is 100% equal the branch 4.0.x so I'm putting the tag "Needs reroll" and marking as "needs works". If this patch is updated just say here and we can merge for us in the sequence

Thank you so much team

viniciuscosta’s picture

Assigned: Unassigned » viniciuscosta

I'll do this update.

viniciuscosta’s picture

Assigned: viniciuscosta » Unassigned
Status: Needs work » Needs review
StatusFileSize
new9.19 KB

Thanks for your help @RenatoG, I made the updates and now the patch applies with the new version of the module.

renatog’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll

Thanks a lot Vini. Great job

2 Points suggestions:

#1 early return and avoid "else", example:

From:

// Load Bootstrap Library only if necessary.
  if (!empty($loadBootstrap)) {
    $bootstrapVersion = $config->get('bootstrap_version');
    if (!isset($bootstrapVersion) || $bootstrapVersion == '3x') {
      $attachments['#attached']['library'][] = 'modal_page/modal-page-bootstrap-3';
    }
    else {
      $attachments['#attached']['library'][] = 'modal_page/modal-page-bootstrap-5';
    }
  }

to

 // Load Bootstrap Library only if necessary.
  if (empty($loadBootstrap)) {
    return;
  }

  $bootstrapVersion = $config->get('bootstrap_version');
  if (!isset($bootstrapVersion) || $bootstrapVersion == '3x') {
    $attachments['#attached']['library'][] = 'modal_page/modal-page-bootstrap-3';
    return;
  }

  $attachments['#attached']['library'][] = 'modal_page/modal-page-bootstrap-5';

}

#2 the hook update isn't working because the previous one is higher than the new one
previous: modal_page_update_400013 - new: modal_page_update_50001

To recognize we need to put modal_page_update_500001

P.S. These numbers are wrong, I think we can report a new ticket to solve that in the future. But for now I think we need to follow the sequence

renatog’s picture

Status: Needs work » Needs review
StatusFileSize
new9.14 KB
new1.28 KB

Since the changes on #31 is quickly I did it here, follow the new patch with these fixes applied

  • 2f7b250 committed on 5.0.x
    Issue #3313638 by viniciuscosta, RenatoG, juancec: Create Support to...
renatog’s picture

Status: Needs review » Fixed

Moved to the dev branch and kept the autor as @viniciuscosta

New version launched at https://www.drupal.org/project/modal_page/releases/5.0.0-beta3 where is saying thanks a lot to Vini and Juancec for your great job on this! You're rock!

Have a great weekend

Status: Fixed » Closed (fixed)

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