Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Settings form action URL malformed

Status Resolved
Add-on / Version Publisher Lite 1.6.2
Severity
EE Version 1.9.0

LouWii D.

Apr 10, 2015

Hi,

On EE 2.9.0, the settings form action url is malformed due to a EE 2.9.0 bug.

action="admin.php?/cp&admin;.php?/cp/addons_modules/show_module_cp&module=publisher&method=settings_save"

In order to have the correct URL in the form, I modified third_party/publisher/libraries/Publisher/helpers/Publisher_helper_cp.php
and on the line 272, I added that code :

if (version_compare(APP_VER, '2.9.0', '='))
{
    //we need to force to have full cp url
    $url = str_replace(SELF, '', $url);
    $url = ee()->config->item('cp_url').$url;
}

In 2.9.0, the cp_url method doesn’t have the third parameter to force the url to be full (with http://). That work around fixes that. As we have a url beginning with http://, the method form_open() will not modify the action url and the form will work as expected.

action="http://thewebsite.dev/admin.php?/cp/addons_modules/show_module_cp&module=publisher&method=settings_save"

I don’t know if you want to put it as a fix in the future release, but I thought I’d let you know if someone goes into that issue.

#1

BoldMinded (Brian)

What EE bug is it? Can you share a link to their bug list? If its a bug in EE I’m probably not going to make a patch like this to Publisher… its a gross fix to something that isn’t my issue 😊

#2

LouWii D.

In you settings view, you use

<?php echo form_open($save_url, array('id' => 'settings'), $hidden); ?>

The $save_url is admin.php?/cp/addons_modules/show_module_cp&module=publisher&method=settings_save And the outputted HTML code :

<form acti method="post" id="settings">

The URL will obviously not work. That’s why I needed the $save_url to be a full url.

If the $save_url is http://mywebsite.dev/admin.php?/cp/addons_modules/show_module_cp&module=publisher&method=settings_save The ouputted HTML code will be correct.

<form acti method="post" id="settings">

In EE > 2.9.0, your code will work because you are using cp_url($var, $var, TRUE). The third parameter is forcing the URL to be a full URL. But that third parameter doesn’t exist in EE 2.9.0.

I might be not that clear… Sorry, it’s not easy to explain.

#3

BoldMinded (Brian)

I think its clear, thanks for the detailed report. I’ll give it a look.

#4

BoldMinded (Brian)

LouWii, I just went ahead and added this to the Publisher code, even though I don’t like doing it 😊

Login to reply