Support Forum

Update Memberships button problem

21 Answers

New Answer

MP Mr Papa
Mr Papa
Member

mapge??

could look in /usr/local/apache/modules on your server and see if its in there too… of course, assumes you are running apache…

well, still need to figure out what your server does not like… not much I can do until we figure out what is causing the 500 error… its not generally happening on other sites…

SP SPQC
SPQC
Member

Update!

I just looked into Admin Toolbox, then Error Log, and this is what happen when I click to update :

 

file: /simple-press/sp-api/sp-api-filters.php
line: 1641
function: stripslashes
Notice | Array to string conversion

 

I think I just nailed it, right?  Hope it’s a good clue.  I should have seen this before…  what I was seeing instead was the server Error Log.

 

The server Error Log show :

Premature end of script headers: /wp/index.php

MP Mr Papa
Mr Papa
Member

well, not sure…  it is only a notice – not an error… but we can try something… in sp-ahah-profile-save.php, around line 103, can you change

            if (isset($_POST['usergroup_join'])) {
                $update = true;
                $joins = sp_esc_str($_POST['usergroup_join']);
                foreach ($joins as $membership) {
                    sp_add_membership($membership, $thisUser);
                }
            }

to

            if (isset($_POST['usergroup_join'])) {
                $update = true;
                foreach ($_POST['usergroup_join'] as $membership) {
                    $membership = sp_esc_int($membership);
                    sp_add_membership($membership, $thisUser);
                }
            }
SP SPQC
SPQC
Member

Tested and this is showing below the box (below the update button I click) :

Parse error: syntax error, unexpected T_VARIABLE in /wp-content/plugins/simple-press/forum/profile/ahah/sp-ahah-profile-save.php on line 104 

 

Line 104 is your line 2 in previous post.

MP Mr Papa
Mr Papa
Member

please verify its entered correct… that line did not change from before.. nor did #1

SP SPQC
SPQC
Member

wow, I deleted the file and started over and it works!  Dunno what was wrong, I’m sure I pasted correctly the 1st time.

 

Now the same problem was happening when I wanted to remove but I was able to deduct from your code how to change the remove block just over it.  smile

 

What could explain I was the only one having the problem?  What’s different in my installation?  Could be that there was not a lot of people who tested it.

MP Mr Papa
Mr Papa
Member

that’s a good question – no clue why…  and yes, I only gave you change for adding…

I actually like my code mods better, so will make them standard…  but not sure why it was a problem…