Problem with 1.5 session_name

Discussion corner for Developers of Serendipity.
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Problem with 1.5 session_name

Post by Don Chambers »

garvinhicking wrote:Hi!

Actually, it's Smarty that is trying to do it a ssecond time. Maybe something inside the Smarty code is trying to reload its own libraries due to some function loading.

This would mean inspecting a lot of the Smarty internal code...

Regards,
Garvin
Is it trying to load a library, or is it simply trying to declare a plugin path, which would clearly be different for the serendipity version vs. the aMember version, as they are in different locations.

Latest email from aMember is not much help:
your amember installation works fine - http://www.example.com/amember/member.php
Errors only on main page - http://www.example.com/
If this is Serendipity page then please contact their support to fix it.
Something I just discovered. I am NOT getting the error as of this morning. The error had previously been occuring the first time I accessed the site for the day. I would not receive the error again until the next day. Today, I am not receiving the error at all, but I have others checking for the error. IN the past few weeks, I had been the only one visiting the site. Is it possible that the FIRST person to access the site receives the error, then no one else will?
=Don=
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Problem with 1.5 session_name

Post by Don Chambers »

Well, I am screwed without a solution to this smarty thing. The error is clearly being generated by s9y's copy of smarty. It also seems quite clear that this error only happens perhaps once in a specific time period (daily?) after which, no one else will receive the error. As mentioned before, it might be session related?

Everything else seems to be resolved regarding s9y & aMember... except this. Without a solution, aMember and s9y cannot be used together. aMember support has repeatedly explained that there is nothing they can do as the problem lies with the fact that aMember has alrleady loaded smarty, then s9y loads it again creating a conflict. Is there anything that can be done to s9y's version of smarty to prevent this conflict, or have I reached a dead end in my attempts to get these two scripts to work together?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problem with 1.5 session_name

Post by garvinhicking »

Hi!

I agree, it seems to be session related. Maybe someone with Smarty internal knowledge can solve this? Maybe you can ask on the Smarty support forums, what can be done when Smarty is included multiple times and how it can be worked around.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Problem with 1.5 session_name

Post by Don Chambers »

I found the exact problem posted on Smarty.net forums. Unfortunately, there was no follow-up, and no solid solution.

Here is another forum post where the solution was to overwrite one version of smarty with another. Problem I have with that is that aMember and s9y use a different folder structure for smarty.

For what it is worth, the s9y version of smarty appears to be 2.6.26 and the aMember version of smarty is 2.6.2.

One final question on this code in s9y's functions_smarty.inc.php:

Code: Select all

            // Default Smarty Engine will be used
            @define('SMARTY_DIR', S9Y_PEAR_PATH . 'Smarty/libs/');
            if (!class_exists('Smarty')) {
                include SMARTY_DIR . 'Smarty.class.php';
            }
Isn't that supposed to detect aMember's smarty and not include s9y's version of Smarty.class.php?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problem with 1.5 session_name

Post by garvinhicking »

Hi!

Thats a good hint. Try to upgade the amember smarty to the same version as well?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Problem with 1.5 session_name

Post by Don Chambers »

garvinhicking wrote:Hi!

Thats a good hint. Try to upgade the amember smarty to the same version as well?

Regards,
Garvin
I'm not entirely sure how to do it - the smarty folder structures are not the same... unless that is due to the differences in versions. Any thoughts on that?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problem with 1.5 session_name

Post by garvinhicking »

Hi!

Really? Usually the Smarty dir structure should be the same -- did amember customize its Smarty maybe? Smarty 2.6.x always had the same layout like it is in s9y...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Problem with 1.5 session_name

Post by Don Chambers »

I've just about reached the limit of my patience with aMember.

The folder structures are not the same. For instance, aMember smarty structure looks like this:

mysite.com/amember/smarty/
mysite.com/amember/smarty/core/
mysite.com/amember/smarty/plugins/

s9y's smarty structure looks like this:

mysite.com/bundled-libs/Smarty/
mysite.com/bundled-libs/Smarty/libs/
mysite.com/bundled-libs/Smarty/libs/internals/
mysite.com/bundled-libs/Smarty/libs/plugins/

As near as I can tell, the following folder contents are an approximate match:

aMember: mysite.com/amember/smarty/
s9y: mysite.com/bundled-libs/Smarty/libs/

amember: mysite.com/amember/smarty/core/
s9y: mysite.com/bundled-libs/Smarty/libs/internals/

mysite.com/amember/smarty/plugins/
mysite.com/bundled-libs/Smarty/libs/plugins/

The files that exist in mysite.com/bundled-libs/Smarty/ simply do not exist in the aMember version, but appear to be mostly text files such as changelogs, release notes, etc. I may try overwriting the aMember smarty files with s9y's, but I still have a problem with that: As I asked earlier, isn't serentipity supposed to correctly detect the existence of smarty and NOT load? If so, why isn't that working?

EDIT: I noticed something while revising some template files today. Occasionally I had a typo, and therefore an error. I was working on two files - config.inc.php and entries.tpl. Once in awhile, either due to a legitimate (no error) modification, or an unintentional error, I was triggering the same error. I have no idea why. If my modification did not contain a typo/code mistake, simply refreshing the page would make the smarty error go away. If it was a code problem, fixing the code and then refreshing made the smarty error go away. I did not ALWAYS get errors just because I made modifications, it happened only a few times. Any idea why??????

And here is another thought - WHY is it I am being told Serendipity's version of Smarty cannot do something because aMember already has???? At the point this is happening, aMember has not even been called yet..... :? :? :?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problem with 1.5 session_name

Post by garvinhicking »

Hi!

It's not s9y not properly loading smarty, it's Smarty not properly detecting another instance of Smarty loading itself, I believe. It's hard to say, but it's a bit outside the scope of s9y, more inside the scope of Smarty.

Maybe "core" was renamed to "internals" at some point, I don't remember. you could check past releases on smarty.net?

About your changes: I believe this comes because faulty templates cannot be compiled and force a recompile which could then trigger the error, and after reload the properly compiled template and the proper smarty session wouldn't show that again?
And here is another thought - WHY is it I am being told Serendipity's version of Smarty cannot do something because aMember already has???? At the point this is happening, aMember has not even been called yet..... :? :? :?
I believe amember stores Objects inside the session which lead to inclusion of files once the session is initialized...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Problem with 1.5 session_name

Post by Don Chambers »

Thanks again Garvin - I realize I am chasing a needle in a haystack here. aMember tells me that their version of smarty is modified, and upgrading it on my own is not recommended. Other than that, they continue to blame Serendipity for the problem because the error shows up on the home page which is generated by s9y, and not aMember.

I did leave a message on the smarty forums, but no one has replied. Sadly, I think I have reached the end of the road. The problem is really not related to s9y per se, aMember does not believe they should do anything to resolve it, the issue has been raised in the past on the Smarty forums, and again by me, but no one is responding.

aMember says their version of smarty is customized, but they did not say how. I would love to upgrade it to the same as s9y, but I fear I could crash the whole thing in the process.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problem with 1.5 session_name

Post by garvinhicking »

Hi!

I couldn't really understand the issue, but I believe it's related to the session initalization and the loading of Class files upon session init. Other than that, I belive it to be a Smarty core mismatch. It's really hard to say, without sinking hours of "learning" Smarty core into this...

I must admit that other than wanting to help you personally, my motivation to dig into this is quite low, as I don't personally need it and feel the application of amember is only interesting for commercial sites, so I am personally a bit annoyed to dig into an amember cooperation issue for free, while they charge for their software, future users of amember+s9y would get payments, and we (read: I) do not. ;)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Problem with 1.5 session_name

Post by Don Chambers »

I hear you Garvin - while I do know someone I would like to convert to s9y, he would need aMember, or soemthing like it, to protect content for his members. Like you, I am also frustrated with aMember - THEY are the ones charging money for their script AND their serendipity plugin - neither of which worked with serendipity when I first got them. I have spent many, many weeks getting their plugin to work. You personally helped me resolve a session issue due to s9y 1.5's unique session name.

I would not say the only application for amember + s9y is "commercial". It is for membership sites, which may, or may not, charge visitors to access. aMember seems to be the most widely distributed script of its kind, and works with nearly every CMS I have ever heard of... except s9y, which is the only one that uses smarty.

I am going to scan their files - if the only references to smarty subfolder names is within the smarty files themselves, I may try to overwrite their version of smarty. Worse case is I have to restore a backup.

I sincerely appreciate your continued assistance despite the fact that the only one making money from this - at the moment - is amember.
=Don=
Post Reply