<![CDATA[ Newspublisher and non-standard contexts - My Forums]]> https://forums.modx.com/thread/?thread=43477 <![CDATA[Re: Newspublisher and non-standard contexts]]> https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-481847 BobRay Nov 05, 2013, 03:13 AM https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-481847 <![CDATA[Re: Newspublisher and non-standard contexts]]> https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-481750 Quote from: BobRay at May 18, 2013, 12:49 AM
Some other things to try:

Comment out lines 1529 and 1530:

// $controller = $this->modx->getOption('request_controller',null,'index.php');
// $goToUrl = $controller . '?id=' . $postId;


If that doesn't do it, try changing line 1524 to this:

$goToUrl = $this->modx->makeUrl($postId, $this->resource->get('context_key'), "", "full");


Let me know if anything works.

I had the same problem that after editing a resource and clicking submit, it would save the resource perfectly but redirect to www.mywebsite.com/en/index.php?id=23.
Using your above suggestions fixed this issue for me. I'm on modx 2.2.9]]>
[email protected] Nov 04, 2013, 11:02 AM https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-481750
<![CDATA[Re: Newspublisher and non-standard contexts]]> https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-467195
]]>
BobRay May 25, 2013, 07:54 AM https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-467195
<![CDATA[Re: Newspublisher and non-standard contexts]]> https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-467152 matpiaz May 24, 2013, 03:42 PM https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-467152 <![CDATA[Re: Newspublisher and non-standard contexts]]> https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-467020
If so, the next update may (or may not) fix things for you.]]>
BobRay May 23, 2013, 02:15 AM https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-467020
<![CDATA[Re: Newspublisher and non-standard contexts]]> https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-467019 matpiaz May 23, 2013, 02:07 AM https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-467019 <![CDATA[Re: Newspublisher and non-standard contexts]]> https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-467002
For new resources, if this code isn't there already, it might help to add it above the makeUrl() call, but after the save:

$modx->reloadContext('web');


Part of the problem is that makeUrl() is ultimately a method of the Context object and I'm not sure there's a way to know which context it is at the point where the user is forwarded.

One trick that sometimes helps is to set a $_SESSION variable with the Resource ID and forward the user to an intermediate page with a known URL. On that page, a snippet checks the $_SESSION variable and forwards the user to the target page.

BTW, make sure the user is logged in to all Contexts they might be sent to (using something like &contexts=`web,de,context3`) in the Login snippet tag).
]]>
BobRay May 22, 2013, 05:13 PM https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=4#dis-post-467002
<![CDATA[Re: Newspublisher and non-standard contexts]]> https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=3#dis-post-466934
$goToUrl = $this->modx->makeUrl($postId, 'web', "", "full");

(the default "web" context works great).

With that mod in place the "edit existing post" side is improved: after submit, it correctly redirects to the right resource.
No luck with the "post new resource" instead... still blank page.

By the way, thank you for your support!]]>
matpiaz May 22, 2013, 02:15 AM https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=3#dis-post-466934
<![CDATA[Re: Newspublisher and non-standard contexts]]> https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=3#dis-post-466910
Could you try this: Comment out those first two lines I mentioned above, then hard-code the correct context into the makeUrl() line like this:

$goToUrl = $this->modx->makeUrl($postId, 'web', "", "full");

That might help determine where it's going wrong.
]]>
BobRay May 21, 2013, 03:58 PM https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=3#dis-post-466910
<![CDATA[Re: Newspublisher and non-standard contexts]]> https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=3#dis-post-466900 Could it be due to a particular .htaccess configuration maybe?]]> matpiaz May 21, 2013, 02:22 PM https://forums.modx.com/thread/43477/newspublisher-and-non-standard-contexts?page=3#dis-post-466900