News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Can't Access Forum Profile

Started by pepa, February 22, 2018, 12:53:49 AM

Previous topic - Next topic

pepa

If I as Admin or any users try to navigate to their forum profile they receive the following message in their browser:

"The www.reformaps.net.au page isn't working

www.reformaps.net.au is currently unable to handle this request.
500"

Checked the error logs and they're clean.

Anyone know what's causing this?

Aleksi "Lex" Kilpinen

A 500 error is an error on the server side, and should leave an entry in the server logs, try to locate them - or ask your host for them.
We need to know the error message, to be able to help.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

pepa

Quote from: Aleksi "Lex" Kilpinen on February 22, 2018, 01:08:51 AM
A 500 error is an error on the server side, and should leave an entry in the server logs, try to locate them - or ask your host for them.
We need to know the error message, to be able to help.

Thanks Aleski ... this would appear to be the relevant error message:

"[Thu Feb 22 17:09:03.529821 2018] [:error] [pid 637191] [client 58.104.95.218:52135] PHP Fatal error:  Call to undefined function BetterProfile_Profile() in /home/psychol1/reformaps.net.au/forum/Sources/Profile-Modify.php on line 764"

shawnb61

Do you have the Better Profile mod installed?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

pepa

Quote from: shawnb61 on February 22, 2018, 01:26:36 AM
Do you have the Better Profile mod installed?

No, I did install it recently due to a request by Dougie, but then uninstalled it ... has it left a problem behind?

Also, when I did install it, it didn't work.  Neither does Better Messages Menu.

pepa

Thanks shawnb61 ... you gave me the clue I needed.  The offending lines in Profile-Modify.php were:

   BetterMessages_Profile($profile_fields);
   BetterMessages_Profile($profile_fields);
   BetterProfile_Profile($profile_fields);

Just removed them and now all is OK.

Guess I better let Dougie know.

dougiefresh

Yeah, that's what happens when you uninstall mods in the wrong order, then force the uninstall through without paying attention to the errors....

In order to make sure you uninstall mods in the right order, I really recommend installing Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

pepa

Quote from: dougiefresh on February 22, 2018, 10:56:03 AM
Yeah, that's what happens when you uninstall mods in the wrong order, then force the uninstall through without paying attention to the errors....

In order to make sure you uninstall mods in the right order, I really recommend installing Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Sorry Dougie, but I'm not guilty of what you suggest.  I only installed BetterProfileMenu after you asked me if it would work for me.  Installed it and it didn't work.  Now I find I can't uninstall it.  With regard to BetterMessages Menu I have only installed each new version after uninstalling the previous version ... and I have "never" uninstalled or installed any mod on SMF that has thrown up error messages when it runs the check immediately before the process.

If you are referring to the order of installing/uninstalling mods in general, I can't comment as I was unaware that some mods may have to be uninstalled before others, but, as above, for Better Messages and Better Profile, that was my process.

Aleksi "Lex" Kilpinen

Sometimes on some server setups these things do just happen without clear cause, but if any errors in uninstallation come up, it can many times be solved by following the original installation order in reverse until the right package comes up.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

pepa

Quote from: Aleksi "Lex" Kilpinen on February 23, 2018, 12:09:30 AM
Sometimes on some server setups these things do just happen without clear cause, but if any errors in uninstallation come up, it can many times be solved by following the original installation order in reverse until the right package comes up.

Thanks for your reply Aleksi, however I can't follow that process in this case as there have been 4 versions of BetterMessagesMenu installed the latest version is suddenly throwing up uninstall errors.  All the previous versions were uninstalled as soon as it was evident they didn't work, none of those threw out errors on uninstallation, but I can't install any of those previous versions as having the latest version installed prevents this.  So I'm presently stuck with bits of code I can't get rid of and don't know if they will eventually cause problems somewhere.  Not sure what to do?

Doug Heffernan

Quote from: pepa on February 24, 2018, 12:17:28 AM
Quote from: Aleksi "Lex" Kilpinen on February 23, 2018, 12:09:30 AM
Sometimes on some server setups these things do just happen without clear cause, but if any errors in uninstallation come up, it can many times be solved by following the original installation order in reverse until the right package comes up.

Thanks for your reply Aleksi, however I can't follow that process in this case as there have been 4 versions of BetterMessagesMenu installed the latest version is suddenly throwing up uninstall errors.  All the previous versions were uninstalled as soon as it was evident they didn't work, none of those threw out errors on uninstallation, but I can't install any of those previous versions as having the latest version installed prevents this.  So I'm presently stuck with bits of code I can't get rid of and don't know if they will eventually cause problems somewhere.  Not sure what to do?

You can check the mod xml file and undo the edits manually. Or you can overwrite your forum files with files from a freshly downloaded smf. Note to download the version that you are using and do not leave any install and/or upgrade files as they seem to pose a security issue. You must also note that doeing this will uninstall all mods. You can re install them again though.

pepa

Quote from: doug_ips on February 24, 2018, 08:48:53 AM
Quote from: pepa on February 24, 2018, 12:17:28 AM
Quote from: Aleksi "Lex" Kilpinen on February 23, 2018, 12:09:30 AM
Sometimes on some server setups these things do just happen without clear cause, but if any errors in uninstallation come up, it can many times be solved by following the original installation order in reverse until the right package comes up.

Thanks for your reply Aleksi, however I can't follow that process in this case as there have been 4 versions of BetterMessagesMenu installed the latest version is suddenly throwing up uninstall errors.  All the previous versions were uninstalled as soon as it was evident they didn't work, none of those threw out errors on uninstallation, but I can't install any of those previous versions as having the latest version installed prevents this.  So I'm presently stuck with bits of code I can't get rid of and don't know if they will eventually cause problems somewhere.  Not sure what to do?

You can check the mod xml file and undo the edits manually. Or you can overwrite your forum files with files from a freshly downloaded smf. Note to download the version that you are using and do not leave any install and/or upgrade files as they seem to pose a security issue. You must also note that doeing this will uninstall all mods. You can re install them again though.

Hi doug

Thanks for your suggestion, I'm learning a lot about SMF in a short time, it's all good : )

Checked, and there are three xml files.  One is the package-info.xml which doesn't write any changes.  The other two are "language_english.xml" which writes to Profile.English.php.  Easy to just remove that txt.

Dougiefresh Please Note:  The text has been written twice at the bottom of this file, so could be a previous uninstall from an earlier version left it behind.

and ... "install_20x.xml" which writes the following to Loap.php, Profile-Modify.php and PersonalMessage.php:

<file name="$sourcedir/Load.php">
<!-- loadUserSettings function -->
<operation>
<search position="before"><![CDATA['permissions' => array(),]]></search>
<add><![CDATA[
'bmm_mode' => isset($user_settings['bmm_mode']) ? $user_settings['bmm_mode'] : 0,]]></add>
</operation>
</file>
<file name="$sourcedir/Profile-Modify.php">
<operation>
<search position="after"><![CDATA[

$disabled_fields = !empty($modSettings['disabled_profile_fields'])]]></search>
<add><![CDATA[
BetterMessages_Profile($profile_fields);]]></add>
</operation>
<operation>
<search position="after"><![CDATA[ 'theme_settings',]]></search>
<add><![CDATA[ 'bmm_mode', 'hr',
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[ 'ignore_boards',]]></search>
<add><![CDATA[
'bmm_mode',]]></add>
</operation>
</file>
<file name="$sourcedir/PersonalMessage.php">
<!-- MessageMain function -->
<operation>
<search position="before"><![CDATA['settings' => 'MessageSettings',]]></search>
<add><![CDATA[
'BetterMessages_ucp' => 'BetterMessages_Hook',]]></add>
</operation>

<!-- messageIndexBar function -->
<operation>
<search position="after"><![CDATA[// Do we have a limit on the amount of messages we can keep?]]></search>
<add><![CDATA[// If we are being called by the Better Messages mod, return with the array:
if (isset($_GET['sa']) && $_GET['sa'] == 'BetterMessages_ucp')
{
$context['pm_areas'] = $pm_areas;
return;
}

]]></add>
</operation>
</file>
</modification>


So if I remove those edits ... all will be OK?

Doug Heffernan

Quote from: pepa on February 24, 2018, 04:49:22 PM
Quote from: doug_ips on February 24, 2018, 08:48:53 AM
Quote from: pepa on February 24, 2018, 12:17:28 AM
Quote from: Aleksi "Lex" Kilpinen on February 23, 2018, 12:09:30 AM
Sometimes on some server setups these things do just happen without clear cause, but if any errors in uninstallation come up, it can many times be solved by following the original installation order in reverse until the right package comes up.

Thanks for your reply Aleksi, however I can't follow that process in this case as there have been 4 versions of BetterMessagesMenu installed the latest version is suddenly throwing up uninstall errors.  All the previous versions were uninstalled as soon as it was evident they didn't work, none of those threw out errors on uninstallation, but I can't install any of those previous versions as having the latest version installed prevents this.  So I'm presently stuck with bits of code I can't get rid of and don't know if they will eventually cause problems somewhere.  Not sure what to do?

You can check the mod xml file and undo the edits manually. Or you can overwrite your forum files with files from a freshly downloaded smf. Note to download the version that you are using and do not leave any install and/or upgrade files as they seem to pose a security issue. You must also note that doeing this will uninstall all mods. You can re install them again though.

Hi doug

Thanks for your suggestion, I'm learning a lot about SMF in a short time, it's all good : )

Checked, and there are three xml files.  One is the package-info.xml which doesn't write any changes.  The other two are "language_english.xml" which writes to Profile.English.php.  Easy to just remove that txt.

Dougiefresh Please Note:  The text has been written twice at the bottom of this file, so could be a previous uninstall from an earlier version left it behind.

and ... "install_20x.xml" which writes the following to Loap.php, Profile-Modify.php and PersonalMessage.php:

<file name="$sourcedir/Load.php">
<!-- loadUserSettings function -->
<operation>
<search position="before"><![CDATA['permissions' => array(),]]></search>
<add><![CDATA[
'bmm_mode' => isset($user_settings['bmm_mode']) ? $user_settings['bmm_mode'] : 0,]]></add>
</operation>
</file>
<file name="$sourcedir/Profile-Modify.php">
<operation>
<search position="after"><![CDATA[

$disabled_fields = !empty($modSettings['disabled_profile_fields'])]]></search>
<add><![CDATA[
BetterMessages_Profile($profile_fields);]]></add>
</operation>
<operation>
<search position="after"><![CDATA[ 'theme_settings',]]></search>
<add><![CDATA[ 'bmm_mode', 'hr',
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[ 'ignore_boards',]]></search>
<add><![CDATA[
'bmm_mode',]]></add>
</operation>
</file>
<file name="$sourcedir/PersonalMessage.php">
<!-- MessageMain function -->
<operation>
<search position="before"><![CDATA['settings' => 'MessageSettings',]]></search>
<add><![CDATA[
'BetterMessages_ucp' => 'BetterMessages_Hook',]]></add>
</operation>

<!-- messageIndexBar function -->
<operation>
<search position="after"><![CDATA[// Do we have a limit on the amount of messages we can keep?]]></search>
<add><![CDATA[// If we are being called by the Better Messages mod, return with the array:
if (isset($_GET['sa']) && $_GET['sa'] == 'BetterMessages_ucp')
{
$context['pm_areas'] = $pm_areas;
return;
}

]]></add>
</operation>
</file>
</modification>


So if I remove those edits ... all will be OK?

You are welcome. I'm learning a lot about SMF in a short time as well.

I think that if you undo all the edits manually the issue might get resolved. However, I am speaking in theory as I do not use that mod. Whereas the ther method that I mentioned about overwriting your forum files will work 100%. I have tried it myself with success.

Have you tried to post at the support topic of that mod btw? Its developer can help you better I think.

pepa

#13
Quote from: doug_ips on February 24, 2018, 04:55:45 PM

You are welcome. I'm learning a lot about SMF in a short time as well.

I think that if you undo all the edits manually the issue might get resolved. However, I am speaking in theory as I do not use that mod. Whereas the ther method that I mentioned about overwriting your forum files will work 100%. I have tried it myself with success.

Have you tried to post at the support topic of that mod btw? Its developer can help you better I think.

Thanks again doug : ).  Yep I'm aware of the "other" method but it would be a lot of work as I've made many changes to my forum, all documented but still hours of work after I upload a "clean file set".  My forum isn't throwing up any error messages so I think I'll go with your xml edits suggestion.  If the worst happens I can always install a clean set from the large upgrade file.

I have posted in the relevant mod thread but I think dpugiefresh is really busy atm.  He did suggest using Arantor's Sortable Packages (and Installed Time) mod, which is a great mod, but didn't help at all with this situation.

I'll mark this topic as solved now, I'm pretty confident it is.

pepa

Thanks again for your suggestion doug-lps

Removed all the vagrant code from the files mentioned above and all is good with the forum, although I will still have to remove something from the db as there is a db_install.php file with this mod.

Interesting to note that there was leftover code in all the relevant files from uninstallations of previous versions of BetterMesagesMenu and were the uninstallations had "supposedly" been successful.

Now, as expected I guess, when I click uninstall for BetterMessagesMenu V1.4 it throws an error for every file.  So should I uninstall , which I believe won't do anything as I've already removed the code, but it will remove the 'installed' listing from the package manager?

Doug Heffernan

Quote from: pepa on February 25, 2018, 05:50:25 AM
Thanks again for your suggestion doug-lps

Removed all the vagrant code from the files mentioned above and all is good with the forum, although I will still have to remove something from the db as there is a db_install.php file with this mod.

Interesting to note that there was leftover code in all the relevant files from uninstallations of previous versions of BetterMesagesMenu and were the uninstallations had "supposedly" been successful.

Now, as expected I guess, when I click uninstall for BetterMessagesMenu V1.4 it throws an error for every file.  So should I uninstall , which I believe won't do anything as I've already removed the code, but it will remove the 'installed' listing from the package manager?

You are welcome pepa. If you removed the code manually the mod is searching for the code that adds and when it does not found it throws the error. I think you can safely uninstall it as it will not do anything but remove it from the installed listing of the package manager.

However, before you perform anything that has to do with the database, it would be best to first backup the database for just in case things will not go as planned, you can always roll back.

Advertisement: