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

Decode permalinks with URL encoding #13551

Merged
merged 5 commits into from
Feb 18, 2019

Conversation

Naerriel
Copy link
Contributor

Description

Fixes #13229.
Currently slug for the permalink is encoded and that PR simply decodes it.

How has this been tested?

Ran npm run test and looked on the permalinks that were previously encoded and saw that they were decoded.

Screenshots

image

Types of changes

Bug fix.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

Questions:

I've had doubts where in the code this decoding should be done and I've chose the view, as it probably isn't needed elsewhere. Please let me know, what you think.

@youknowriad youknowriad added Internationalization (i18n) Issues or PRs related to internationalization efforts Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code labels Jan 29, 2019
@youknowriad youknowriad requested review from a team and earnjam January 29, 2019 09:25
@gziolo
Copy link
Member

gziolo commented Jan 29, 2019

I think @earnjam or @jorgefilipecosta should be the best suited to help to validate the changes proposed.

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

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

Hi @Naerriel,
Thank you for this improvement.
I noticed there is another place we need to fix. If we go to title the permalink editor appears above it. If we press edit we see the field with the encoded representation. Probably we should add another decodeURIComponent call.

@Naerriel
Copy link
Contributor Author

Hi @jorgefilipecosta
I have made another decodeURIComponent call in permalink editor, as you have suggested it. During that fix I have also found that post-publish-panel/panel.js also requires decoding. Maybe we could just decode it straight in the store?

If I'm correct, I could just decode it in reducer to action REQUEST_POST_UPDATE_SUCCES. What do you think?

@gziolo gziolo added this to the 5.1 (Gutenberg) milestone Feb 7, 2019
@Naerriel
Copy link
Contributor Author

Naerriel commented Feb 8, 2019

Hey @earnjam,
Are those changes satisfactory?

@earnjam
Copy link
Contributor

earnjam commented Feb 14, 2019

Sorry for the delay @Naerriel. Just did some testing and this PR looks good to me!

@noisysocks noisysocks merged commit 54bae98 into WordPress:master Feb 18, 2019
@noisysocks noisysocks added the [Type] Bug An existing feature does not function as intended label Feb 18, 2019
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Decode URL encoding slug in sidebar permalink

* Decode URL encoding slug in sidebar permalink pt.2.

* Decode URL encoding slug in sidebar permalink pt.3.

* Decode URL encoding slug in sidebar permalink pt.4.
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Decode URL encoding slug in sidebar permalink

* Decode URL encoding slug in sidebar permalink pt.2.

* Decode URL encoding slug in sidebar permalink pt.3.

* Decode URL encoding slug in sidebar permalink pt.4.
@rachidev84
Copy link

there's another issue when you switching wordpress to arabic language :
about RTL :
the permalink display in RTL not in LTR, it must be in LTR because that how it show on all browser.
this is how it look like on wordpress in edit post :
https://prnt.sc/o76dkn

and this is how must be : https://www.byarabic.com/مقالة-الموقع/
Another issue is if someone copy my post link from website and past it in other place via facebook messenger or any browser it show them url with %%%% like this :
https://www.byarabic.com/%d9%85%d9%82%d8%a7%d9%84%d8%a9-%d8%a7%d9%84%d9%85%d9%88%d9%82%d8%b9/

@aduth
Copy link
Member

aduth commented Jun 27, 2019

@rachidev84 Can you please create a new issue so that this is properly tracked, since this pull request is already merged and will not likely receive much future attention from collaborators?

https://github.com/WordPress/gutenberg/issues/new/choose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Permalinks with RTL on them, displaying their codes instead of the characters
8 participants