xml session errors after 2.14 upgrade?

11 posts by 2 authors in: Forums > CMS Builder
Last Post: January 12, 2012   (RSS)

Re: [rez] xml session errors after 2.14 upgrade?

By Jason - January 11, 2012

Hi,

This type of error is usually caused by there being something at the top of the page before the first <?php tag. This is normally just a blank line. What happens is that blank line is interpreted by server as output, and put in the output buffer. If there is already output, you can't create a session, which is what the membership plugin is attempting.

Try making sure that your <?php tag is at the very top of the page. That should take care of the issue.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] xml session errors after 2.14 upgrade?

By rez - January 11, 2012

Definitely nothing before the opening php tag. It's the first and only thing on the line with nothing before it. :/

Re: [rez] xml session errors after 2.14 upgrade?

By rez - January 11, 2012

Is it something to do with:

?><<?php ?>?xml version="1.0" encoding="utf-8"?>

That was a trick Dave showed me when I think I had trouble getting that line to show up or something. (would have to look up my old thread).

Re: [rez] xml session errors after 2.14 upgrade?

By Jason - January 11, 2012

Hi,

It's strange that it's telling you that there is output coming from line 1. Could you attach the .php file your working with so I can take a closer look at your code?
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [rez] xml session errors after 2.14 upgrade?

By rez - January 11, 2012

I just used the same slideshow xml code from a working site with another version of CMSB. It only gives the error on this site.

I could be wrong but this seems to back up the fact that these slideshows worked until upgrade?

Re: [Jason] xml session errors after 2.14 upgrade?

By rez - January 11, 2012 - edited: January 11, 2012

Oh... I see what you mean, The page is attached.
Attachments:

csrxml.php 2K

Re: [rez] xml session errors after 2.14 upgrade?

By rez - January 11, 2012

note, I forgot to change the list code when copying from my other site but still not getting past that error.

list($csr_slideshowRecords, $csr_slideshowMetaData) = getRecords(array(
'tableName' => 'csr_slideshow',
));

Re: [rez] xml session errors after 2.14 upgrade?

By Jason - January 11, 2012

Hi,

My guess would be that your other site isn't running Website Membership, which is why it isn't running into any session errors.

Try this change:

<?php
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/xxxx/public_html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

// load records
list($slideshowRecords, $slideshowMetaData) = getRecords(array(
'tableName' => 'csr_slideshow',
));

?>
<?php header('Content-type: application/xml; charset=utf-8'); ?><?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<SlideshowBox>
<items>
<?php foreach ($csr_slideshowRecords as $record): ?>
<?php foreach ($record['slide'] as $upload): ?>
<item>
<thumbnailPath><?php echo $upload['thumbUrlPath2'] ?></thumbnailPath>
<largeImagePath><?php echo $upload['thumbUrlPath'] ?></largeImagePath>
<fullScreenImagePath><?php echo $upload['urlPath'] ?></fullScreenImagePath>
<title><![CDATA[<?php echo $upload['title'] ?>]]></title>
<description><![CDATA[<?php echo $upload['dsc'] ?>]]></description>
</item>
<?php endforeach ?>
<?php endforeach ?>
</items>
</SlideshowBox>


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] xml session errors after 2.14 upgrade?

By rez - January 11, 2012 - edited: January 18, 2012

ohhhh. "session" error. i didnt get that it was a membership thing. unfortunately, i still get the session error even with your change.

Well with membership plugin disabled and using your line of code gives me (looking at the source):

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxx/public_html/csrxml.php:1) in /home/xxxxx/public_html/csrxml.php on line 11
<?xml version="1.0" encoding="UTF-8"?>

and then my xml file shows the records correctly below that for the first time. Line 11 is the line you changed.

Removing that xml line altogether makes the slideshow work but not when the membership plug is enabled. I get the session error.

Same thing with the original code from dave makes a perfect xml file with doc type and working slideshow without the membership enabled but gives me the original session error of course (where we started) with membership enabled.

Still trying with no luck. I need help getting the xml fixed with membership enabled. thanks.