-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Sitemap filename can't exceed 32 characters #13937 #20044
Sitemap filename can't exceed 32 characters #13937 #20044
Conversation
Hi @irajneeshgupta. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Using the objectmanager doesn't seem to be the best path here, care to recheck? |
@miguelbalparda |
911538e
to
f8654d1
Compare
@miguelbalparda |
21f4361
to
ab2e514
Compare
f6bc76b
to
71a0047
Compare
9f3bb74
to
55cf2dc
Compare
@miguelbalparda can you please review changes. |
Hi @aleron75, thank you for the review. |
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.
Thanks for your contribution @irajneeshgupta , please see my code review notes.
/** | ||
* @var $_stringValidator | ||
*/ | ||
public $_stringValidator; |
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.
Please change properties access level to private and remove the underscore prefix from property names
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.
Okay , I will made these changes.
* @param \Magento\Sitemap\Model\SitemapFactory $sitemapFactory | ||
*/ | ||
public function __construct( | ||
\Magento\Backend\App\Action\Context $context, |
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.
Please add dependencies in a backward compatible way, see "Adding a constructor parameter" section of Backward compatible development guide for details
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.
okay I will update it.
const MAX_FILENAME_LENGTH = 32; | ||
|
||
/** | ||
* @var $_stringValidator |
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.
Please correct propeties' types in phpdocs
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.
okay I will make these changes
/** | ||
* @var \Magento\Framework\Validator\StringLength|\PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
protected $lengthValidator; |
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.
it's preferable to declare properties as private unless they are used by child classes
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.
okay sure
…kward compatible constructor params
c4d191d
to
035e8d7
Compare
I have made changes that you recommended. Thanks. |
Hi @aleron75, thank you for the review. |
@sivaschenko |
Hi @irajneeshgupta thanks for your fixes, the pull request is being processed internally. |
Hi @irajneeshgupta, thank you for your contribution! |
Description (*)
The Sitemap filename length validation was not added , hence added
\Magento\Framework\Validator\StringLength
max 32 length validation for sitemap filename and it will not trim filename exceeding 32 chars. Client side validation in filename field of form is also added to fix this issue'validate-length maximum-length-32'
. UpdatedsaveTest
unit test case.Fixed Issues (if relevant)
Contribution checklist (*)