-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[4.1] Allow save as copy article in the frontend #32520
[4.1] Allow save as copy article in the frontend #32520
Conversation
Is it possible to turn off this feature? Testing Instructions |
@chnnst The testing instructions are complete and clear enough for everybody who is familiar with Joomla. |
I have tested this item 🔴 unsuccessfully on 3615d42 The same Author user was able to save a new article without problems and the Publishing tab did not include any Featured option. When teh Author user edited this last article, the Featured option in Publishing showed 'No' and then pushing Save resulted the same error, 0 Invalid field: Start Featured Will now install the lastest Beta8-dev from scratch for further testing. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32520. |
I have tested this item ✅ successfully on debf2f2 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32520. |
@richard67 joomdonation Is it possible to turn off this feature? |
@chnnst Don't worry about it. This feature is not accepted yet. If it is accepted and you don't like this feature, you can easy turn it off by implementing a template override. |
We don't want a template override, we want an option button to turn this feature off. |
@chnnst You do not need it does not mean other users do not need it. This is up to maintainers to decide. You or me do not have the right to make decision. |
The easiest way to switch it off is to use an account for frontend editing who has the permission to edit existing articles but not to create new ones. |
@richard67 that's awkward way to switch it off, better way is an option button to turn this feature off. can you provide real life data for article base on that existing article? To understand why you need this feature to be implemented? |
@chnnst Joomla! has Save As Copy option for long time from administrator area. This PR just makes that option available for frontend. If it is not needed, then people would not open this discussion #28092 . If it is not needed, then Joomla won't need Save As Copy feature in administrator area You want Joomla 4 to release NOW, so please stop wasting time of other people to answer your questions for nothing. |
Not even the Save button is working from the front end for an Author user in an unpatched out-of-the-box full version of Beta8-dev just installed today. The error message is always "0 Invalid field: Start Featured", independent of the state of Featured, whether the Start Featured date was selected from the Calendar icon or not. I will raise a new item about this error. Test environment: This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32520. |
Thanks @toivo . Please open a new issue for that. I will try to look at it later today (please give me a clear instructions to see the error) |
@joomdonation your new feature which are not needed create new issues, please stop proposing them to j4 but better propose them to 4.1 or later . We want Joomla 4 to release NOW, so please stop wasting time of other people, and better test release blockers. |
@chnnst @joomdonation - The error "0 Invalid field: Start Featured" occurs in an out-of-the-box Beta8-dev in my Windows test environment with PHP 8.0.2, independent of any patches. Here are the steps I followed: Beta8-dev full version installed on Wampserver, PHP 8.0.2 Create an Author user. Content - Categories and create a new category, 'My Category'. Add a menu item to Main Menu, Create Article and select 'My Category' as the category. Login as the Author user. Create an article from the front end. Edit the article from the front end as the Author user. Expected result: The article is saved Result: 0 Invalid field: Start Featured Go to the Category Blog and edit the article. Go to the Category Blog and edit the article. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32520. |
Thanks @toivo. I will try to re-procedure the issue myself and get it sorted. |
The front end Author user already had the permissions 'Edit' and 'Edit State' to that particle article from Author to Publisher but was unable to save the article without the error. After the user group of this front end user was changed from Author to Publisher, this user was able to save the article without issues. I will raise this as a new issue now. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32520. |
It turns out that giving to the user group Author the permission to Edit State in an article or the category causes the error. Changed the 'Edit State' permission to Inherited and therefore by calculation 'Not Allowed (Inherited)' in the article and granted the Edit State permission to Author in the category. When the Author tries to save the article from the front end, we get "0 Invalid field: Start Featured." When the 'Edit State' permission is changed back to 'Inherited' and therefore by calculation 'Not Allowed (Inherited)', the Author user can save the article without any issues. Perhaps this is not an issue. Should we say that an Author with the permission 'Edit State' should be a Publisher instead? Otherwise we will have an endless number of permutations of items, categories, user groups and permissions that some of our users think should work. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32520. |
@toivo It is actually an issue with permission checking. I will find a way to solve it. |
I have tested this item 🔴 unsuccessfully on debf2f2 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32520. |
@ceford You at least need to change Title of the article before press Save As Copy button to have article created, otherwise, you will see an error message That same behavior is applied for Save As Copy button in the backend. So in short, you need to change Title of the article (so that a unique Alias will be generated for the new article) to have the article created |
In the backend test I did not change the Title - the system appended (2) to the existing title and created a new alias. |
@ceford OK. I will check that backend behavior to see how it is handled and make adjustment here. Could you confirm that if you change Title of article before pressing Save As Copy, the new article is being created properly? |
I am using Multi-lingual Test Data. I tried changing the article title with Save as Copy and it just save the existing article with the new title. |
@joomdonation steps 1 - 3 = OK, but Step 4: "0 Invalid field: Start Featured." This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32520. |
@ChristineWk Thanks for testing. We have a bug need to be fixed first before we can continue with this PR. So please wait until the PR #32524 is merged before testing it again Many thanks ! |
In my case around 200 websites where authors everytime have to redo the same article structure in frontend, because save© doesn't exist. Only solution is let they can access to the admin, and this is wrong, really wrong. |
When updating a component the success message should be green not blue
* min value zero * min multiplier
The description for the group of this module has not been updated since the module was enhanced and changed in J4. As a result the information about the core icons is not correct any more and this PR resolves that.
* btn sizes * Subform styling for non table layout * scss cs * scss cs * scss cs * Highlight draggable section * Highlight same color as other site
Shorten the user list headlines to improve the width of the user list table
* [4.0] download key tip * change to a link * remove debug * style * fix styles and link * route * updated tooltip * id
// If the article is being edited and the current user has permission to create article | ||
if ($this->item->id | ||
&& ($user->authorise('core.create', 'com_content') || \count($user->getAuthorisedCategories('com_content', 'core.create')))) | ||
{ | ||
$showSaveAsCopy = true; | ||
} | ||
else | ||
{ | ||
$showSaveAsCopy = false; | ||
} | ||
|
||
$this->showSaveAsCopy = $showSaveAsCopy; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things here:
$this->showSaveAsCopy
should be defined as (protected?) class variable- why this extra variable
$showSaveAsCopy
either assign it direct to$this->showSaveAsCopy
or do something like:
$this->showSaveAsCopy = $this->item->id && ....;
@@ -161,6 +161,12 @@ | |||
<span class="icon-check" aria-hidden="true"></span> | |||
<?php echo Text::_('JSAVE'); ?> | |||
</button> | |||
<?php if ($this->showSaveAsCopy) : ?> | |||
<button type="button" class="btn btn-primary" data-submit-task="article.save2copy"> | |||
<span class="icon-check" aria-hidden="true"></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't there a copy icon?
Sorry. I merged 4.0-dev into this branch and messed up the PR. Will close this one for now and redo it later. |
Pull Request for Issue # .
Summary of Changes
This PR adds support for Save As Copy article from frontend of your site
Testing Instructions