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

Add ability to save an article from the frontend without being redirected (#37312) #37362

Merged
merged 11 commits into from
Mar 26, 2022

Conversation

magnussinger
Copy link
Contributor

Pull Request for Issue #37312.

Summary of Changes

Added a new button to the article edit form on the frontend. It allows the user to save the article without closing the form. This corresponds with the functionality of the backend.

Testing Instructions

Edit an article from the frontend, the button will be on the bottom and you can save the article without being redirected

Actual result BEFORE applying this Pull Request

Only the ability to save the article and get redirected to it right afterward

Expected result AFTER applying this Pull Request

You can choose to only save the article and stay inside the edit form

Documentation Changes Required

None

@magnussinger magnussinger changed the title fix issue #37312 Add ability to save an article from the frontend without being redirected (#37312) Mar 24, 2022
@ChristineWk
Copy link

I have tested this item ✅ successfully on 6ffe565


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

@richard67
Copy link
Member

@bembelimen Is this a new feature and so has to go into 4.2? Or can it be considered a progressive enhancement so it's ok for 4.1.x (likely 4.1.2)?

@bembelimen
Copy link
Contributor

4.2 please

@richard67
Copy link
Member

@magnussinger Could you rebase the PR to 4.2-dev? Let us know if we shall help with that.

@magnussinger
Copy link
Contributor Author

@richard67 yes sure

@joomla-cms-bot joomla-cms-bot added NPM Resource Changed This Pull Request can't be tested by Patchtester Unit/System Tests labels Mar 24, 2022
@roland-d
Copy link
Contributor

@magnussinger You can add the new language string JSAVEANDCLOSE to the language/en-GB/joomla.ini file.

@roland-d roland-d changed the base branch from 4.1-dev to 4.2-dev March 24, 2022 19:44
@joomla-cms-bot joomla-cms-bot added PR-4.2-dev and removed Unit/System Tests NPM Resource Changed This Pull Request can't be tested by Patchtester labels Mar 24, 2022
@joomla-cms-bot joomla-cms-bot added the Language Change This is for Translators label Mar 24, 2022
@magnussinger
Copy link
Contributor Author

@roland-d thanks for the info, I added it

@magnussinger
Copy link
Contributor Author

@roland-d I just tested your idea and it didn't work, I would leave it like I did it

@roland-d
Copy link
Contributor

@magnussinger Why would it not work? I see no reason why it would not work. Looking further we could improve it better like this:

$menuitem = (int) $params->get('redirect_menuitem');

if (in_array($this->getTask(), ['save2copy', 'apply'], true))
{
	return $result;
}

// Check for redirection after submission when creating a new article only
if ($menuitem > 0 && $articleId == 0)

This works for me.

@magnussinger
Copy link
Contributor Author

Yes, you are right this works for me too. I edited it

@richard67
Copy link
Member

@ChristineWk Could you test again with the latest changes? Thanks in advance.

@ChristineWk
Copy link

I have tested this item ✅ successfully on 2b900dc

Don't know if important as it's not part of this PR:
Also clicked: save as copy. Message: Save failed with the following error: Category is required. Would possibly fit there: #37354
But everything here refers to the frontend.


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

@RickR2H
Copy link
Member

RickR2H commented Mar 25, 2022

I have tested this item ✅ successfully on 2b900dc


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

@RickR2H
Copy link
Member

RickR2H commented Mar 25, 2022

RTC


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

@RickR2H RickR2H added the RTC This Pull Request is Ready To Commit label Mar 25, 2022
@fancyFranci fancyFranci merged commit f61cc13 into joomla:4.2-dev Mar 26, 2022
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Mar 26, 2022
@fancyFranci
Copy link
Contributor

Thank you Magnus

@richard67
Copy link
Member

Yes, congratulations @magnussinger to your (as far as I know) first merged pull request for Joomla CMS.

@magnussinger
Copy link
Contributor Author

Thank you @fancyFranci and @richard67 and all the others for helping me with this. It was indeed my first pull request, and I'm looking forward to some more :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Change This is for Translators
Projects
None yet
Development

Successfully merging this pull request may close these issues.