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

Framework: ES Modules + Tree Shaking #16057

Merged
merged 10 commits into from
Jan 24, 2018
Prev Previous commit
Next Next commit
fix getPagePath
  • Loading branch information
samouri committed Jan 23, 2018
commit c2404e9403d022ac1354dcee65ebbdd060208b54
5 changes: 3 additions & 2 deletions client/lib/posts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import url from 'url';
import i18n from 'i18n-calypso';
import moment from 'moment-timezone';
import { includes } from 'lodash';
import { includes, get } from 'lodash';

/**
* Internal dependencies
Expand Down Expand Up @@ -205,7 +205,8 @@ export const getPagePath = function( post ) {
getPermalinkBasePath( post );
}

return removeSlug( post.URL );
const postUrl = get( post, [ 'other_URLs', 'permalink_URL' ] ) || post.URL;
return removeSlug( postUrl );
Copy link
Member

Choose a reason for hiding this comment

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

... and you can also revert this back to just return removeSlug( post.URL ) -- the permalink case was already handled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While I think thats true, it'll fail one of the unit tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

edit: i lied. it works fine now that the return was added back :)

};

/**
Expand Down