Latest News: (loading..)
MTG Mania

Deprecated: Assigning the return value of new by reference is deprecated in/admin/includes/classes/xml_5.php on line 25

22 posts in this topic

Hiya.

 

I downloaded and installed the USPS Methods 6.1a module, along with the required xml files, and lo and behold (I knew this wasn't going to be "easy" lol) I get this error in my admin panel when I go to download and re-install the module (per the instructions that came with the add on) Deprecated: Assigning the return value of new by reference is deprecated in /home/xxxxxxx/xxxxxx_xxxx/admin/includes/classes/xml_5.php on line 25.

 

I followed the instructions step by step, and VERY slowly, triple checking the whole way making sure I was putting what goes where in the correct spots. Any ideas on this error and why I am getting it? Any advice on fixing it?

 

Here is the string of coding:

 

//##################################################################################

// XML_unserialize: takes raw XML as a parameter (a string)

// and returns an equivalent PHP data structure

//##################################################################################

function & XML_unserialize(&$xml){

$xml_parser = &new XML(); <--------------------------- LINE 25

$data = &$xml_parser->parse($xml);

$xml_parser->destruct();

return $data;

}

//##################################################################################

// XML_serialize: serializes any PHP data structure into XML

// Takes one parameter: the data to serialize. Must be an array.

//##################################################################################

function & XML_serialize(&$data, $level = 0, $prior_key = NULL){

if($level == 0){ ob_start(); echo '<?xml version="1.0" ?>',"\n"; }

while(list($key, $value) = each($data))

Share this post


Link to post
Share on other sites

I'm not entirely sure this will work, but try this:

 

$xml_parser = new XML();

Share this post


Link to post
Share on other sites

You'll have to fix Line 26 as well:

 

$data = $xml_parser->parse($xml);

 

Regards

Jim

Share this post


Link to post
Share on other sites

@@germ

 

Thank you!!! That worked. Buuuuuut.... NOW... I installed, set the settings for everything, click save and WHAMMO!!!

This is my greeting!

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home/admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home/admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /homel/admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39

 

Warning: Cannot modify header information - headers already sent by (output started at //admin/modules.php:39) in /home/admin/includes/functions/general.php on line 34

 

Allllllll over my admin panel.

 

 

Here is the code:

 

if (tep_not_null($action)) {

switch ($action) {

case 'save':

reset($HTTP_POST_VARS['configuration']);

while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {

if( is_array( $value ) ){

$value = implode( ", ", $value);

$value = ereg_replace (", --none--", "", $value);

}

tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");

}

tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module']));

break;

case 'install':

case 'remove':

 

 

And here is funtions:

 

 

if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {

tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));

}

 

header('Location: ' . $url); <--------------------- Line 34

 

if (STORE_PAGE_PARSE_TIME == 'true') {

if (!is_object($logger)) $logger = new logger;

$logger->timer_stop();

}

 

exit;

}

 

A little help with this too, please? :sweating: :blush:

Edited by MTG Mania

Share this post


Link to post
Share on other sites

Try:

 

$value = preg_replace ('/, --none--/', '', $value);

Share this post


Link to post
Share on other sites

@@germ LMAO Well, that fixed the admin panel throwing up all over itself, but the original error is back now. :lol: :'(

Share this post


Link to post
Share on other sites

ROFL but the module works.... sort of! LMAO except for that string of "error" code showing on the top of my checkout/shipping page

Share this post


Link to post
Share on other sites

You'll have to post the error message.

 

I'm not "magic" like you.

:blush:

Share this post


Link to post
Share on other sites

@@germ

 

It's the same original one..... Deprecated: Assigning the return value of new by reference is deprecated in /includes/classes/xml_5.php on line 25

Share this post


Link to post
Share on other sites

Shit. Wait a minute. Reading is my friend. It's the OTHER XML file now giving me shit. One second, let me make sure it's not the same coding error there too.

Share this post


Link to post
Share on other sites

@@germ LMAO Well, that fixed the admin panel throwing up all over itself, but the original error is back now. :lol: :'(

 

I like the visual....

(w00t)

 

So what';s the code from the file on line 25?

:unsure:

Share this post


Link to post
Share on other sites

Holy crap, it's a MIRACLE. I fixed it. Thanks, you guys!! You are awesome for helping this php MORON, who obviously needs to READ things a little better!!!

Share this post


Link to post
Share on other sites

@@germ I fixed it (I think, hope pray lol) Thank you so much for helping me!! You, and the others like you have NO idea how much I appreciate it!! Without you guys helping me along the way, I never would have figured HALF of this stuff out!!!

Share this post


Link to post
Share on other sites

Hi Magic, congrats... :)

 

So please update the addon then.

 

Sara

Share this post


Link to post
Share on other sites

Hi Magic, congrats... :)

 

So please update the addon then.

 

Sara

 

Do I just download my "fixed" php's and upload it as a "fix" on the add on page that I downloaded it from, or? I have not updated any add on's before.

 

And thanks!! lol Without the 2 Jim's I would have been in a real fix, so the credit is really due to them!!

 

Cindy

Share this post


Link to post
Share on other sites

Hi Cindy, best is to upload a new package with comments on what's fixed, how and where.

 

So, zip your version and upload with a new number.

 

Sara

 

Coding is a looooooooot of coffe... and snacks... :)

Share this post


Link to post
Share on other sites

Coding is a looooooooot of coffe... and snacks... :)

 

Wondered why I was putiing on weight and feeling hyper :)

Share this post


Link to post
Share on other sites

Wondered why I was putiing on weight and feeling hyper :)

 

You and me both!!

Share this post


Link to post
Share on other sites

Hi Cindy, best is to upload a new package with comments on what's fixed, how and where.

 

So, zip your version and upload with a new number.

 

Sara

 

Coding is a looooooooot of coffe... and snacks... :)

 

I doesn'e look like the new updated files were ever uploaded to the site, because it looks like the most recent version, 6.1b , was added back on February 16, 2012.

 

Would be great if the updated files could be added by somebody ... I could really use it right now!

Share this post


Link to post
Share on other sites

Thanks Jim and Jim! This also fixed a checkout problem with OSC 2.3.3 and PHP 5.3 in the /catalog/includes/classes/xml_5.php file. It took me a while to find this thread, but glad I did.

 

Thanks again,

 

Dave

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now