Advertisement:

Author Topic: Unable to Post, have to Log in Every time to do Admin after installing 2.0.15  (Read 643 times)

Offline Obrieden

  • Newbie
  • *
  • Posts: 8
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

Offline Colin

  • Lead Developer
  • SMF Hero
  • *
  • Posts: 7,767
  • Gender: Male
  • SMF Developer
    • colinschoen on GitHub
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

Offline Obrieden

  • Newbie
  • *
  • Posts: 8
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

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 48,077
did you have a reason for edit mod installed at some point in the past?

Offline Obrieden

  • Newbie
  • *
  • Posts: 8
I don't know what edit mod is

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,105
  • 'Tis the gift to be simple
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

Online Gwenwyfar

  • Customizer
  • Full Member
  • *
  • Posts: 693
  • Gender: Female
    • Gwenwyfar on GitHub
Did you have the update to 2.0.14 before you installed 2.0.15?

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,105
  • 'Tis the gift to be simple
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.

Offline Obrieden

  • Newbie
  • *
  • Posts: 8
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.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,105
  • 'Tis the gift to be simple
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 -

Code: [Select]

&#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 -

Code: [Select]

&#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 -

Code: [Select]

// 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 -

Code: [Select]

// 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>';



Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 48,077
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

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,105
  • 'Tis the gift to be simple
How about reinstalling/uninstalling the mod, would that remove the column?  May be safer than sending OP into database.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 48,077
that depends on the mod, not all offer the abliity to remove the database changes.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,119
  • Gender: Male
    • Kindred-999 on GitHub
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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Obrieden

  • Newbie
  • *
  • Posts: 8
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

Offline Obrieden

  • Newbie
  • *
  • Posts: 8
It appears that updating the version of php to 7.0 has fixed the problem. Thank you very much for your time.

Otis

Offline Obrieden

  • Newbie
  • *
  • Posts: 8
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.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,119
  • Gender: Male
    • Kindred-999 on GitHub
You do know that it is normal to have a password check when an admin goes into the admin section?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Obrieden

  • Newbie
  • *
  • Posts: 8
It never has before.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,051
    • Arantor on GitHub
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"
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.