markjaquith / page-links-to

#WordPressPlugin: Lets you make a WordPress page (or other content type) link to an external URL of your choosing, instead of its WordPress URL.
GNU General Public License v2.0
110 stars 46 forks source link

Page Links To no longer working - seems compatibility issue with WPML #146

Open IlseO76 opened 3 years ago

IlseO76 commented 3 years ago

Hi Mark,

Somehow 'Page Links To' has stopped working on one of my sites for links to external pages, while it still works when I link a page to an internal page. It seems to be a conflict with WPML.

See https://www.moralmarkets.org/blog/page/2/?et_blog. The link from the post "Green Swans..." to an internal page still works, while the link from the post "Karl Marx..." to an external post no longer works - clicking on the post takes you to the WP dashboard (if you are logged in) or to the login page (if you are not yet logged in).

The reason why I think it is a compatibility issue with WPML: if you go to the network tab in the browser inspector', and look at the 'response headers' for the 301 item, you see "x-redirect-by WPML". It say the same in case of an internal link added with Page Links to, but apparently WPML is able to handle those internal links.

Any suggestions on what to try and do to fix this?

IlseO76 commented 3 years ago

Thanks by the way for making this plugin available. I've been using it for years with great satisfaction, would be a real bummer if I cannot get it to work again.

IlseO76 commented 3 years ago

Found a work-around in this post: https://wpml.org/forums/topic/strange-redirections-occuring-as-soon-as-wmpl-is-enabled/, namely:

Go to wp-content/plugins/sitepress-multilingual-cms/classes/query-filtering/class-wpml-query-parser.php, line no.280 and comment out following line:

1 | list( $q, $redir_pid ) = $this->maybe_adjust_name_var( $q );