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

[GlobalStep] Non-functional edit button present when viewing own site. #13314

Open
wptester9845 opened this issue Jan 29, 2020 · 6 comments · Fixed by Automattic/jetpack#14514

Comments

@wptester9845
Copy link

wptester9845 commented Jan 29, 2020

Description

If the user chooses to view their own site, each post within it will have a footer with information such as the author name, and the data published. The last part of the footer will be an edit icon with no text. Tapping this icon has no function.

On web the edit icon is present with the text “Edit” next to it. Tapping this text will allow the user to edit that post.

Reproduction Rate

4/4 100%

Expected behavior

Either the edit button should be function when tapped, or having matching text “edit” which allows the user to edit their post.
Or the edit button should be removed as the functional text link is not present on mobile.

Actual behavior

An edit icon is present with no function.

Steps to reproduce the behavior

  1. Launch WordPress 14.1 (14.1.0.0)
  2. Log into an account which has at least one site and one or more post.
  3. Tap View Site.
  4. Observe the edit icon as the end of the footer in any post.
  5. Attempt to interact with the edit icon.
Tested on

iPhone XS (12.3.1)

iOS - Edit Icon.zip

Screen Shot 2020-01-29 at Jan 29 11 58 27 AM

Submitted By:

Alex Wood

@designsimply
Copy link
Contributor

This is a tricky case. In the past, we disabled the edit icon as a stopgap because admin area links, including the editor as well as some other areas of WP Admin, weren't working well within Webviews (the view that opens when you tap 'View Site') and causing quite a bit of confusion for people using the app. That said, there is an issue at #12074 requesting to make that Edit link open the editor within the app if possible and I'd like to close this in favor of that request. Thank you!

@designsimply
Copy link
Contributor

Re-opening because I talked it out with my team and the edit link should either be removed completely if it's non-functional or we should make the link work and open the editor within the app as requested at #12074.

@designsimply
Copy link
Contributor

@jeherve I think this might be a regression of Automattic/jetpack#12867 and I noticed you were the code reviewer on that issue. Is there any chance you can help us out in getting this re-checked and fixed so that we don't have a non-functional edit link in Webviews in the mobile apps?

(internal reference: p77Llu-ccd-p2)

@designsimply
Copy link
Contributor

I tested this in Safari on iPhone 6S iOS 13.3 and found that "Edit" appears next to the icon as a clickable link and the icon is also there but is not clickable. It seems like the edit link got removed (as intended) but the icon got left behind and the icon isn't clickable on the web or in the mobile app Webviews.

IMG_3287

jeherve added a commit to Automattic/jetpack that referenced this issue Jan 29, 2020
Fixes wordpress-mobile/WordPress-iOS#13314

This issue was introduced in #12867.

The original goal of this change was to to hide the Edit Post link
whenever you would access your site via the mobile app's in-app browser.

To hide the Edit Post link, we originally opted to hook into the edit_post_link filter.
While this works, it only changes the string returned for the Edit Post link itself.
It does not account for any "before" or "after" parameters that may be passed
when calling the edit_post_link function; those are not part of the filter:
https://github.com/WordPress/WordPress/blob/001ffe81fbec4438a9f594f330e18103d21fbcd7/wp-includes/link-template.php#L1439

Instead, let's shortcircuit that link earlier, by hooking into the get_edit_post_link filter.
If that filter is set to return an empty string, the edit_post_link function will return early:
https://github.com/WordPress/WordPress/blob/001ffe81fbec4438a9f594f330e18103d21fbcd7/wp-includes/link-template.php#L1420
@jeherve
Copy link
Contributor

jeherve commented Jan 29, 2020

@designsimply I can't seem to be able to reproduce your issue on my end (on Android). I don't have an iOS device to test I'm afraid.

The PR you linked to above aimed to remove the Edit link, but only when viewing the site via the in-app browser. It does appear to work still:

Edit link visible when viewing the post in Chrome

Screenshot_20200129-181720

Edit link is gone when viewing the same post via the in-app browser

Screenshot_20200129-181707

Looking at your screenshot above, I don't see the toolbars added by the in-app browser. Were you accessing your site in the browser instead?


An edit icon is present with no function.

I believe this may be because your theme uses the edit_post_link() function to add the edit post link, and provided a "before" or "after" parameter to add the icon before the text. The Jetpack plugin and WordPress.com remove the edit text and its link, but your theme still adds the "before" or "after" element around it.

Twenty Nineteen, for example, does this:
https://github.com/WordPress/WordPress/blob/master/wp-content/themes/twentynineteen/inc/template-tags.php#L115-L130

I've just pushed this PR to try to work around this when themes do that:
Automattic/jetpack#14514

@designsimply
Copy link
Contributor

designsimply commented Jan 29, 2020

My screenshot was comparing Safari (to note the difference). I've updated the original issue to show the Webview screenshot inline.

For reference, I believe the site in the screenshot is from madefortesting9845.wordpress.com and was using the Independent Publisher 2 theme at the time.

I reviewed the PR workaround for both Jetpack and WP.com and both LGTM! ❤️ Thank you @jeherve!

dereksmart pushed a commit to Automattic/jetpack that referenced this issue Feb 12, 2020
Fixes wordpress-mobile/WordPress-iOS#13314

This issue was introduced in #12867.

The original goal of this change was to to hide the Edit Post link
whenever you would access your site via the mobile app's in-app browser.

To hide the Edit Post link, we originally opted to hook into the edit_post_link filter.
While this works, it only changes the string returned for the Edit Post link itself.
It does not account for any "before" or "after" parameters that may be passed
when calling the edit_post_link function; those are not part of the filter:
https://github.com/WordPress/WordPress/blob/001ffe81fbec4438a9f594f330e18103d21fbcd7/wp-includes/link-template.php#L1439

Instead, let's shortcircuit that link earlier, by hooking into the get_edit_post_link filter.
If that filter is set to return an empty string, the edit_post_link function will return early:
https://github.com/WordPress/WordPress/blob/001ffe81fbec4438a9f594f330e18103d21fbcd7/wp-includes/link-template.php#L1420
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants