News:

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

Main Menu

Unable to Post, have to Log in Every time to do Admin after installing 2.0.15

Started by Obrieden, December 07, 2017, 01:38:07 PM

Previous topic - Next topic

Obrieden

I'm not sure how it happened, but somewhere along the way my forum was update with 2.0.13 after which people could not post to old topics or add new one. Kept getting message that I needed to run Update.php which I did not have.

Among other things I tried updating to 2.0.15 and although people can see the boards, not one can post and when they try they get the following message:

Field 'edit_reason' doesn't have a default value
File: /home/frayed6/public_html/eq/boards/Sources/Subs-Post.php
Line: 1817

Please help, we're pretty much dead in the water.

Thanks,
Otis

Colin

Were there errors during the update?

What mods do you have installed?
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Obrieden

The errors occurred after the updates, the last one being what I posted previously.

The installed mods are:

smf 2.0.13 update, bot buster, better smf parser, and smf 2.0.12

Illori

did you have a reason for edit mod installed at some point in the past?


Sir Osis of Liver

Do I understand correctly that this problem appeared when you upgraded to 2.0.13, and you've since upgraded to 2.0.15 and still have same problem?  Did you install all of the upgrades with package manager?

Illori is referring to this mod - https://custom.simplemachines.org/mods/index.php?mod=349
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Gwenwyfar

"It is impossible to communicate with one that does not wish to communicate"

Sir Osis of Liver

Don't think you can install patches out of order using package manager.  If full upgrade package was used, doesn't matter if it was uploaded over .13 or .14, there were no changes to database.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Obrieden

I installed 2.0.15 without installing 2.0.14. I installed it via PHP, not with the package installer. Yes, the problem started after installing 2.0.13 which installed over 2.0.11 without 2.0.12 and it installed with the package installer. I did not install edit mod.

Sir Osis of Liver

The field edit_reason is not in core code, it's added by the 'Reason For Editing Mod' mod.  Appears you had the mod installed prior to upgrading .11 -> .13.  Uploading the upgrade package would have removed the mod, but some code would remain if you're using a theme other than Curve.  The mod adds edit_reason to Subs-Post.php, which would have been overwritten with clean file, and a couple of templates, which are not overwritten in custom theme. 

Your theme should have a Display.template.php, look for this -



&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', '.$txt['reason'].': ' . $message['modified']['edit_reason'] : '' , '  </em> &#187;';



change to this -



&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';




If your theme also has a Post.template.php, find this -



// Reason for Editing Mod
if ((!$context['is_new_post']) && (allowedTo('reason_edit')))
echo '
<div class="padding smalltext">
<strong>'.$txt['reason_edit'].':</strong>
<input type="text" name="edit_reason" size="50" value="" />
</div>';

// If this message has been edited in the past - display when it was.
if (isset($context['last_modified']))
echo '
<div class="padding smalltext">
<strong>', $txt['last_edit'], ':</strong>
', $context['last_modified'], '
</div>';



change to this -



// If this message has been edited in the past - display when it was.
if (isset($context['last_modified']))
echo '
<div class="padding smalltext">
<strong>', $txt['last_edit'], ':</strong>
', $context['last_modified'], '
</div>';



Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Illori

the error is because there is no default value for the column in the database, the column needs a default value added or to drop that column from the database

Sir Osis of Liver

How about reinstalling/uninstalling the mod, would that remove the column?  May be safer than sending OP into database.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Illori

that depends on the mod, not all offer the abliity to remove the database changes.

Kindred

also, the default value error is specific to certain versions of mySQL...  get your host to update mySQL and the issue should be resolved as well.


However, by using the upgrade zip instead of the patch through package manager, you now need to reinstall all of your mods - not reinstalling some mods will put your system in a weird state, especially for mods that have some hooks and some code changes
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Obrieden

I found a Display.template.php in "Core" and in Default" with the statement as follows:

&#38;#38;#38;#38;#38;#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#38;#38;#38;#38;#38;#187;';

but nothing that looks like

&#38;#38;#38;#38;#38;#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', '.$txt['reason'].': ' . $message['modified']['edit_reason'] : '' , '  </em> &#38;#38;#38;#38;#38;#187;';

And there is no Post.Template.php

Obrieden

It appears that updating the version of php to 7.0 has fixed the problem. Thank you very much for your time.

Otis

Obrieden

well, my jubilation was a bit premature. The post problem was fixed by changing the phop version, but we are still having a problem with administrators having to log in even though they are logged in to view and perform administrator things.

Kindred

You do know that it is normal to have a password check when an admin goes into the admin section?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."


Arantor

The double login has been a feature of SMF for well over a decade. You can change it by going to admin, and using the admin search for "admin security"

Advertisement: