Jump to content



Photo
- - - - -

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

usps methods 6.1a add on

  • Please log in to reply
21 replies to this topic

#1   MTG Mania

MTG Mania
  • Members
  • 55 posts
  • Real Name:Cindy Langjahr-Buvarp
  • Gender:Female
  • Location:East Coast USA

Posted 29 July 2012 - 00:44

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))

#2   germ

germ
  • Members
  • 13,921 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 29 July 2012 - 00:54

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

$xml_parser = new XML();
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#3 ONLINE   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,019 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 29 July 2012 - 01:02

You'll have to fix Line 26 as well:

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


Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#4   MTG Mania

MTG Mania
  • Members
  • 55 posts
  • Real Name:Cindy Langjahr-Buvarp
  • Gender:Female
  • Location:East Coast USA

Posted 29 July 2012 - 01:06

@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? /sweatingbullets.gif' class='bbc_emoticon' alt=':sweating:' /> /blush.png' class='bbc_emoticon' alt=':blush:' />

Edited by MTG Mania, 29 July 2012 - 01:11.


#5   germ

germ
  • Members
  • 13,921 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 29 July 2012 - 01:15

Try:

$value = preg_replace ('/, --none--/', '', $value);
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#6   MTG Mania

MTG Mania
  • Members
  • 55 posts
  • Real Name:Cindy Langjahr-Buvarp
  • Gender:Female
  • Location:East Coast USA

Posted 29 July 2012 - 01:23

@germ LMAO Well, that fixed the admin panel throwing up all over itself, but the original error is back now. /laugh.png' class='bbc_emoticon' alt=':lol:' /> /crying.gif' class='bbc_emoticon' alt=':'(' />

#7   germ

germ
  • Members
  • 13,921 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 29 July 2012 - 01:24

Did you catch the post by the other JIm?
/unsure.png' class='bbc_emoticon' alt=':unsure:' />
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#8   MTG Mania

MTG Mania
  • Members
  • 55 posts
  • Real Name:Cindy Langjahr-Buvarp
  • Gender:Female
  • Location:East Coast USA

Posted 29 July 2012 - 01:27

@germ Yup. Took out the & on that line too /whistling.gif' class='bbc_emoticon' alt=':-' />/

#9   MTG Mania

MTG Mania
  • Members
  • 55 posts
  • Real Name:Cindy Langjahr-Buvarp
  • Gender:Female
  • Location:East Coast USA

Posted 29 July 2012 - 01:28

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

#10   germ

germ
  • Members
  • 13,921 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 29 July 2012 - 01:29

You'll have to post the error message.

I'm not "magic" like you.
/blush.png' class='bbc_emoticon' alt=':blush:' />
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#11   MTG Mania

MTG Mania
  • Members
  • 55 posts
  • Real Name:Cindy Langjahr-Buvarp
  • Gender:Female
  • Location:East Coast USA

Posted 29 July 2012 - 01:34

@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

#12   MTG Mania

MTG Mania
  • Members
  • 55 posts
  • Real Name:Cindy Langjahr-Buvarp
  • Gender:Female
  • Location:East Coast USA

Posted 29 July 2012 - 01:35

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.

#13   germ

germ
  • Members
  • 13,921 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 29 July 2012 - 01:36

@germ LMAO Well, that fixed the admin panel throwing up all over itself, but the original error is back now. /laugh.png' class='bbc_emoticon' alt=':lol:' /> /crying.gif' class='bbc_emoticon' alt=':'(' />


I like the visual....
/w00t.gif' class='bbc_emoticon' alt='(w00t)' />

So what';s the code from the file on line 25?
/unsure.png' class='bbc_emoticon' alt=':unsure:' />
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#14   MTG Mania

MTG Mania
  • Members
  • 55 posts
  • Real Name:Cindy Langjahr-Buvarp
  • Gender:Female
  • Location:East Coast USA

Posted 29 July 2012 - 01:40

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!!!

#15   MTG Mania

MTG Mania
  • Members
  • 55 posts
  • Real Name:Cindy Langjahr-Buvarp
  • Gender:Female
  • Location:East Coast USA

Posted 29 July 2012 - 01:42

@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!!!

#16   Juto

Juto
  • Members
  • 369 posts
  • Real Name:Sara
  • Gender:Female

Posted 29 July 2012 - 06:34

Hi Magic, congrats... /smile.png' class='bbc_emoticon' alt=':)' />

So please update the addon then.

Sara

#17   MTG Mania

MTG Mania
  • Members
  • 55 posts
  • Real Name:Cindy Langjahr-Buvarp
  • Gender:Female
  • Location:East Coast USA

Posted 29 July 2012 - 16:43

Hi Magic, congrats... /smile.png' class='bbc_emoticon' alt=':)' />

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

#18   Juto

Juto
  • Members
  • 369 posts
  • Real Name:Sara
  • Gender:Female

Posted 29 July 2012 - 21:02

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... /smile.png' class='bbc_emoticon' alt=':)' />

#19   FWR Media

FWR Media
  • Members
  • 6,839 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 29 July 2012 - 21:27

Coding is a looooooooot of coffe... and snacks... /smile.png' class='bbc_emoticon' alt=':)' />


Wondered why I was putiing on weight and feeling hyper /smile.png' class='bbc_emoticon' alt=':)' />

#20   MTG Mania

MTG Mania
  • Members
  • 55 posts
  • Real Name:Cindy Langjahr-Buvarp
  • Gender:Female
  • Location:East Coast USA

Posted 29 July 2012 - 21:41

Wondered why I was putiing on weight and feeling hyper /smile.png' class='bbc_emoticon' alt=':)' />


You and me both!!