Changes in Controller & Model files (messages & default state functionality)#13
Closed
priiish wants to merge 9 commits intobembelimen:publishing-workflowfrom
Closed
Conversation
…g error was thrown. When trying to delete default state, user received message "Item must be published to set default state" whereas it must be "You are trying to delete the default item.". StateModel.php: changed condition in first if statement in function setDefault(). AdminController.php: commented out else case due to it being unnecessary in the function publish().
…tion in last if statement. Now confirmation message is only sent in case of "real" deletion (>= 0).
…se otherwise the default selection via the star icon wont work #no mistake
either trashed oder unpublished and must be published first (before default can be set).
bembelimen
reviewed
Jul 30, 2018
| } | ||
|
|
||
| if ($ntext !== null) | ||
| if (count($cid) != 0) |
Owner
There was a problem hiding this comment.
I think you could use if (count($cid)) because values larger to 0 equals to true
| { | ||
| // Prune items that you can't change. | ||
| $app->enqueueMessage(\JText::_('COM_WORKFLOW_ITEM_MUST_PUBLISHED'), 'error'); | ||
| $app->enqueueMessage(\JText::_('COM_WORKFLOW_MSG_DELETE_DEFAULT'), 'error'); |
Owner
There was a problem hiding this comment.
Does this language string exists?
Author
There was a problem hiding this comment.
Yes ist does. Have a look at joomla-cms/administrator/language/en-GB/en-GB.com_workflow.ini line 51.
| { | ||
| if ($table->published !== 1) | ||
| if ($table->published != 1) | ||
| { |
table could not be accessed, therefore deletion was not possible & error message was being thrown
…that have items cannot be moved to trash anymore.
bembelimen
pushed a commit
that referenced
this pull request
Mar 16, 2019
bembelimen
pushed a commit
that referenced
this pull request
Dec 7, 2020
The menu class suffix is a menu class on J4, not a suffix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue # .
Summary of Changes
Issue1:
While managing states and trying to delete a state that is set to default the user received an error message saying "Item must be published to set default state." (COM_WORKFLOW_ITEM_MUST_PUBLISHED) whereas it should be "You are trying to delete the default item." (COM_WORKFLOW_MSG_DELETE_DEFAULT).
=> StateModel.php JText
Furthermore the user received a confirmation message even if 0 items were deleted. Changed condition of last if statement in function publish(). Now a confirmation message is only sent if the number of deleted items is greater than 0.
=> AdminController.php
Issue2:
It was not possible to change the default status of the states via the star icon. Fixed this issue.
=> StateModel.php
Testing Instructions
-> Go to Content / Workflows / Workflows / Manage
Expected result
Appropriate (error) messages and functionality of the default option (star icon).
Actual result
Works as expected.
Documentation Changes Required
None.