Skip to content

Commit

Permalink
Merge pull request #13570 from wordpress-mobile/gutenberg/fix-gallery…
Browse files Browse the repository at this point in the history
…-block-processor

Gutenberg - Fix Gallery block uploads when the editor is closed
  • Loading branch information
jd-alexander authored Dec 9, 2020
2 parents c4e5bdb + 05a988b commit 7f77b20
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-----
* [*] My Site: Fixes crash on rotation while editing site title [https://github.com/wordpress-mobile/WordPress-Android/pull/13505]
* [**] Posts List: Adds duplicate post functionality [https://github.com/wordpress-mobile/WordPress-Android/pull/13521]
* [*] Block Editor: Fix Gallery block uploads when the editor is closed [https://github.com/wordpress-mobile/WordPress-Android/pull/13570]

16.3
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public GalleryBlockProcessor(String localId, MediaFile mediaFile, String siteUrl
Element parent = targetImg.parent();
if (parent != null && parent.is("a") && mLinkTo != null) {
switch (mLinkTo) {
case "media":
case "file":
parent.attr("href", mRemoteUrl);
break;
case "attachment":
case "post":
parent.attr("href", mAttachmentPageUrl);
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ object TestContent {
<!-- /wp:gallery -->
"""

const val oldGalleryBlockIdsNotFirst = """<!-- wp:gallery {"linkTo":"attachment","ids":[203,${localMediaId},369]} -->
const val oldGalleryBlockIdsNotFirst = """<!-- wp:gallery {"linkTo":"post","ids":[203,${localMediaId},369]} -->
<figure class="wp-block-gallery columns-3 is-cropped">
<ul class="blocks-gallery-grid">
<li class="blocks-gallery-item">
Expand All @@ -193,7 +193,7 @@ object TestContent {
<!-- /wp:gallery -->
"""

const val newGalleryBlockIdsNotFirst = """<!-- wp:gallery {"linkTo":"attachment","ids":[203,${remoteMediaId},369]} -->
const val newGalleryBlockIdsNotFirst = """<!-- wp:gallery {"linkTo":"post","ids":[203,${remoteMediaId},369]} -->
<figure class="wp-block-gallery columns-3 is-cropped">
<ul class="blocks-gallery-grid">
<li class="blocks-gallery-item">
Expand Down Expand Up @@ -294,7 +294,7 @@ object TestContent {
<!-- /wp:video -->
"""

const val oldGalleryBlockLinkToMediaFile = """<!-- wp:gallery {"ids":[203,${localMediaId},369],"linkTo":"media"} -->
const val oldGalleryBlockLinkToMediaFile = """<!-- wp:gallery {"ids":[203,${localMediaId},369],"linkTo":"file"} -->
<figure class="wp-block-gallery columns-3 is-cropped">
<ul class="blocks-gallery-grid">
<li class="blocks-gallery-item">
Expand All @@ -311,7 +311,7 @@ object TestContent {
<!-- /wp:gallery -->
"""

const val newGalleryBlockLinkToMediaFile = """<!-- wp:gallery {"ids":[203,${remoteMediaId},369],"linkTo":"media"} -->
const val newGalleryBlockLinkToMediaFile = """<!-- wp:gallery {"ids":[203,${remoteMediaId},369],"linkTo":"file"} -->
<figure class="wp-block-gallery columns-3 is-cropped">
<ul class="blocks-gallery-grid">
<li class="blocks-gallery-item">
Expand All @@ -328,7 +328,7 @@ object TestContent {
<!-- /wp:gallery -->
"""

const val oldGalleryBlockLinkToAttachmentPage = """<!-- wp:gallery {"ids":[203,${localMediaId},369],"linkTo":"attachment"} -->
const val oldGalleryBlockLinkToAttachmentPage = """<!-- wp:gallery {"ids":[203,${localMediaId},369],"linkTo":"post"} -->
<figure class="wp-block-gallery columns-3 is-cropped">
<ul class="blocks-gallery-grid">
<li class="blocks-gallery-item">
Expand All @@ -345,7 +345,7 @@ object TestContent {
<!-- /wp:gallery -->
"""

const val newGalleryBlockLinkToAttachmentPage = """<!-- wp:gallery {"ids":[203,${remoteMediaId},369],"linkTo":"attachment"} -->
const val newGalleryBlockLinkToAttachmentPage = """<!-- wp:gallery {"ids":[203,${remoteMediaId},369],"linkTo":"post"} -->
<figure class="wp-block-gallery columns-3 is-cropped">
<ul class="blocks-gallery-grid">
<li class="blocks-gallery-item">
Expand Down

0 comments on commit 7f77b20

Please sign in to comment.