Subscribe to Categories

7 years 9 months ago - 7 years 9 months ago #13 by chrisc
Replied by chrisc on topic Subscribe to Categories
That looks as expected. It was worth checking even if I thought it was a long shot. Need to find a 3.4.8 installation now to test against..

My current suspicion is that the SQL is generated by the system and is picking up the categories field and 'assuming that it need to entered in the table. I an suspecting the table class at the moment. If it fails in the back end as well that would probably convince me. (Possibly comment out line 48 in the back end tables/rialtouser.php file? Just an idea as yet.)

Regards

If you are using our extensions please leave a review at the JED: IP Mapping | Issue Tracker | JAudit | Password Control

Please Log in or Create an account to join the conversation.

7 years 9 months ago #14 by Captainmoomoo
Commented out line 48; I didn't get an error and it said it was saved successfully. However, when I went back into Profile, my saved category was not there.

Please Log in or Create an account to join the conversation.

7 years 9 months ago - 7 years 9 months ago #15 by chrisc
Replied by chrisc on topic Subscribe to Categories
I just came to the same conclusion independently. What I think is happening is that JTable has changed between J3.4.8 and J3.5. In J3.4 I think it builds up the list of columns for the table based upon the identifiers in the file. Hence it was picking up the 'categories' field and building the UPDATE line which then failed.

In J3.5 it seems more intelligent in that it doesn't include categories in the UPDATE list.

BUT and here it gets a bit more complex, we need the 'categories' field because we use it to update the cat_users table. Hence by commenting it out in J3.4 the UPDATE worked but the subscribed categories were not changed. I saw the same on J3.5 when I commented the line out. The clue was the order of the columns in the failing UPDATE statement since it included the moderator and ads columns which are not updated in our code.

So the solution is I will have to consider writing a Table override store routine to handle it myself on J3.4 system. This will take a little while so probably not today as its evening time here. I'll look at it first thing tomorrow and then test it against J3.4 and add some conditional code to handle J3.5 as well.. Do not want to set unrealistic expectations. :)

Another thought might be to modify the 'bind function to ignore the categories field. So in rialtouser.php we would change line 68 from:
function bind($array, $ignore = '')

to
function bind($array, $ignore = array('categories') )

Not tried it on J3.4 but it is innocuous on J3.5 so when I get to a J3.4 instance I will try that as well.

Regards

If you are using our extensions please leave a review at the JED: IP Mapping | Issue Tracker | JAudit | Password Control
The following user(s) said Thank You: Captainmoomoo

Please Log in or Create an account to join the conversation.

7 years 9 months ago #16 by Captainmoomoo
Interesting, I did not think the leap from 3.4 to 3.5 would have affected tables much, if at all. I do appreciate all of your help chrisc (and goeffc, too!), the both of you combined have amazing support, so I know you will look into this and have a fix when it's ready.

As always, if there is anything I can do to help out, please let me know. Thank you!

Please Log in or Create an account to join the conversation.

7 years 9 months ago - 7 years 9 months ago #17 by chrisc
Replied by chrisc on topic Subscribe to Categories
Well I thought I would give you an update.
After creating a new J3.4.8 instance I could replicate the problem and see the error. The fix was more extensive than originally envisaged. The thought about ignoring the column in the bind method was a no go, so we had to delve a little deeper. Anyway to cut a long story short we ended up modifying the back end users model, the back end table, and the front end profileform controller. We have made the changes to the ongoing future 1.3.1 version, which has another feature which we are implementing. We have tested the subscription code changes against 3.4.8 and 3.5.1, so we are reasonably sure we haven't broken anything. We did have to add some specific code for J3.5 due to our inclusion of a new method in the back end user model but that is due to us no longer using the J3.5 method directly.

Along the way we think we also discovered another problem relating to removing all of the subscribed categories for a user. Not too sure about this since it wasn't working on J3.4.8 anyway so it was difficult to be sure, but the problem doesn't exist in our new code anyway.

I will send you a new zip file to play with with some covering notes.

Regards

If you are using our extensions please leave a review at the JED: IP Mapping | Issue Tracker | JAudit | Password Control

Please Log in or Create an account to join the conversation.

Time to create page: 0.188 seconds
Go To Top

Joomla! Debug Console

Session

Profile Information

Memory Usage

Database Queries