Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #10520 (issue with "Save & Close" in modal) + function to update input title when changed #10522

Merged
merged 6 commits into from
May 20, 2016

Conversation

cyrezdev
Copy link
Contributor

@cyrezdev cyrezdev commented May 17, 2016

Pull Request for Issue #10520.

Summary of Changes

  • Fix modal closing for already reviewed and refactoried edit modals.
  • Article and module Select and Edit modals will be reviewed soon with the same improvements and fixes as already merged for com_categories, com_newsfeeds and com_contact, and i will add then this patch in the same time of those upcoming PRs.
  • EDIT: add function to update input title when changed

Testing Instructions

  • Test with edit modal : newsfeed, contact and categories
  • Click on Save and Save & Close with a correct edition (no error), and then with an empty title, or any other possible error (not filled required field).
  • Expected behavior: If an error, Save & Close won't close the modal, and Save will never close the modal (close only when requested, and on successful edition)
  • More detailled testing intructions for reviewed modals here: Modal com_categories: improve Select & Edit Category #10441
  • EDIT: Edit a contact, news feed and/or category, change title, and save and close : this title in the input should be then updated with the new title.

@BurtNL
Copy link
Contributor

BurtNL commented May 17, 2016

I have tested this item ✅ successfully on 2e2af7c

Tested successfully on categories for articles, contacts and newsfeeds. Works as described. Great!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10522.

@infograf768
Copy link
Member

Works OK for all categories.
The edit button is broken for contact and newsfeed individual items: it just does not load the modal anymore here.

@cyrezdev
Copy link
Contributor Author

cyrezdev commented May 17, 2016

@infograf768 did you test on latest staging ?
As it is a fix for already merged changes, and contact and newsfeed were merged only yesterday (just before this issue report).

@infograf768
Copy link
Member

Sure, on latest staging

The error here comes from these changes:

-               . ' href="#contactEdit' . $this->id . 'Modal"'
+               . ' href="#contactEdit' . $this->value . 'Modal"'

and

        $html[] = JHtml::_(
            'bootstrap.renderModal',
-           'categoryEdit' . $this->id . 'Modal',
+           'categoryEdit' . $this->value . 'Modal',

After changing back to $this->id the modals load OK with an href of the type
#contactEditjform_associations_en_GBModal

@andrepereiradasilva
Copy link
Contributor

andrepereiradasilva commented May 17, 2016

hum, i had the exact same problem @infograf768 (and used the latest staging).

@JoomliC also, i notice a small detail not related to this PR.
Just letting you know in case you didn't notice.
When i change the category name from "Photo Gallery" to "Photo Gallery test" the category gets updated, ok. But, the category title in the zone where we have the "Select" "Edit" "Clear" doesn't get updated.
image

@andrepereiradasilva
Copy link
Contributor

@JoomliC the "Edit" modals work on menu items, but not in associations.

@cyrezdev
Copy link
Contributor Author

Ok i see!
I will update this PR in a few hours (have to go) but the reason is alias passed to the value, so adding (int) before $this->value will solve it.
I will do extra checking when back, to be sure ;-)

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @BurtNL


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10522.

@cyrezdev
Copy link
Contributor Author

@andrepereiradasilva @BurtNL @infograf768 PR updated and should work now with associations as well as in menus ;-)

@JoomliC also, i notice a small detail not related to this PR.
Just letting you know in case you didn't notice.
When i change the category name from "Photo Gallery" to "Photo Gallery test" the category gets updated, ok. But, the category title in the zone where we have the "Select" "Edit" "Clear" doesn't get updated.
image

@andrepereiradasilva Added too a new function for edit modal, to update the input title when changed ;-)
So to be tested too!

@cyrezdev cyrezdev changed the title Fix #10520 (issue with "Save & Close" in modal) Fix #10520 (issue with "Save & Close" in modal) + function to update input title when changed May 17, 2016
@andrepereiradasilva
Copy link
Contributor

I have tested this item ✅ successfully on 2214bdc

Done tests in:

  • "Select" and "Edit" buttons in Single Contact and Single News feed menu item types.
  • "Select", "Edit" and "Clear" buttons in newsfeed, contact and category associations.

All worked without issues!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10522.

@infograf768
Copy link
Member

I have tested this item ✅ successfully on 2214bdc

Works great now.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10522.

@infograf768
Copy link
Member

RTc. Thanks! Let's go on for the other modals. 😃


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10522.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label May 18, 2016
@brianteeman brianteeman added this to the Joomla 3.6.0 milestone May 18, 2016
{
$value = (int) $this->value;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Why so complicated?

$value = (int) $this->value;

if (0 == $value)
{
$value = '';
}

Copy link
Contributor

@andrepereiradasilva andrepereiradasilva May 18, 2016

Choose a reason for hiding this comment

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

Doesn't this also work?

$value = (int) $this->value === 0 ? '' : $this->value;

But for me this is a detail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rdeutz i don't have change all existed code, but i agree that as i've simplify some, i can this one too!
Do you agree if i change for this one:
$value = (int) $this->value === 0 ? '' : (int) $this->value;
?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In fact, just updated, with a simplified of active id variable ;-)

@andrepereiradasilva
Copy link
Contributor

andrepereiradasilva commented May 18, 2016

@JoomliC,

So after this PR gets merged, reggarding modals, that i see there is, the main remaining modals (for 3.6.0?):

  • The latest changes also in Articles Edit/List modals
  • The latest changes also in Modules Edit/List modals
  • The same changes in Users List modal (if possible the "- No User -" option be in the modal buttons zone)

And the other less relevant modals (for 3.6.x or 3.7.0?):

  • Use the new viewport height/width in the finder index modal, messages my settings, the multilanguage status module modal, the user notes list modal, redirect bulk import modal, the batch modals and other similiar modals (if other exist).

And some ideas:

  • Converting the"Help" button popup up in a modal?
  • Dynamic viewport height/width in the TinyMCE "+Article" "+Module" buttons?

Is this right? Or do i miss something?

@cyrezdev
Copy link
Contributor Author

@andrepereiradasilva You're right + a few minor improvement for com_template modals ;-)
First i will do priority update : article and module update (because of issues to fix)
Others will be much more cosmetic, consticency, and BS HTML structure standards

About Help, yes, good idea (for when i will have done others ;-) ) !
About TinyMCE, i don't know yet, as it's currently using TinyMCE modals (not Boostrap) which are not responsive. (not check yet, but think it could be possible to use BS modal instead of TinyMCE ones, as those 4 buttons are loaded by plugins.

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @andrepereiradasilva, @BurtNL, @infograf768


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10522.

@cyrezdev
Copy link
Contributor Author

@andrepereiradasilva @rdeutz @infograf768 @BurtNL I have updated the PR, by simplifying the active id $value control (as well commented by @rdeutz 👍 ) :

  • Remove if / else
  • Set empty only if active id is > 0 (do not allow negative id)
  • Use $value in title query request instead of (int) $this->value > 0 as now, with my changes in this PR, the $value variable is set before.

Could review/test again ?
Thanks!

@andrepereiradasilva
Copy link
Contributor

I have tested this item ✅ successfully on 29a6bf9

works fine


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10522.

@cyrezdev
Copy link
Contributor Author

Even if this PR to fix newsfeeds, categories and contacts Select & Edit modals is not merged, i have created the PR for Article Select and Edit Modals with same fixes and updates applied here ;-)
#10557

@infograf768
Copy link
Member

I have tested this item ✅ successfully on 29a6bf9


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10522.

@roland-d
Copy link
Contributor

I have tested this item 🔴 unsuccessfully on 29a6bf9

@JoomliC I am marking this as not tested successfully because I am not sure if this is part of this PR or a separate issue but this catches your attention :)

When I go to Newsfeed (or Articles) and edit an item go to the Images tab, click on the Select for the first image. This brings up the image modal. Clicking the X in the corner works fine but the Cancel button doesn't do anything. I would expect the modal to close here.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10522.

@roland-d
Copy link
Contributor

Removing RTC for now as there is an unsuccessful test.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10522.

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label May 20, 2016
@infograf768
Copy link
Member

@roland-d
I think you found another bug (which I confirm) unrelated to the purpose of this PR.

@cyrezdev
Copy link
Contributor Author

@roland-d I will check it in another PR, as not related to this PR. But well found! 👍
And... the issue is already there in stable 3.5.1 !
So, will check this today ;-)

But you can set RTC again here ;-)

@roland-d
Copy link
Contributor

@JoomliC Thank you for checking, will move this forward.

@roland-d roland-d merged commit 9277f9c into joomla:staging May 20, 2016
@roland-d
Copy link
Contributor

Thanks everybody

@cyrezdev
Copy link
Contributor Author

@roland-d : PR done to fix "Cancel" button in image modal : #10564
;-)

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.

8 participants