Reason For Editing Mod

Started by Nibogo, May 23, 2006, 12:44:11 AM

Previous topic - Next topic

pocttopus

Quote from: MacRR on November 07, 2016, 03:32:34 PM
Hey, thanks for the reply. I do not understand how it works? How can I enable it?

Thank you!

After installation you can modify a post and bellow the post there is a little text field to fill the reason for editing. Save the changes and that's it.
It's simple and it's not a rocket science.  ;)

MacRR

Hey, thanks for the reply. I got to the mod :)

Is it possible to turn the mod Finnish language?

Nibogo

Quote from: MacRR on November 08, 2016, 02:10:43 AM
Hey, thanks for the reply. I got to the mod :)

Is it possible to turn the mod Finnish language?

Just open /Themes/default/languages/Modifications.finnish.php and before "?>" add the following:


// Reason for editing mod
$txt['reason'] = 'Reason';
$txt['reason_edit'] = 'Reason For Edit';
$txt['permissionname_reason_edit'] = 'Set Reason for edit';
$txt['permissionhelp_reason_edit'] = 'Set if the membergroup is allowed to put the reason for edit their own posts.';
// Reason for editing mod END


You just need to replace the strings between the apostrophes

MacRR

Quote from: Nibogo on November 08, 2016, 08:21:11 AM
Quote from: MacRR on November 08, 2016, 02:10:43 AM
Hey, thanks for the reply. I got to the mod :)

Is it possible to turn the mod Finnish language?

Just open /Themes/default/languages/Modifications.finnish.php and before "?>" add the following:


// Reason for editing mod
$txt['reason'] = 'Reason';
$txt['reason_edit'] = 'Reason For Edit';
$txt['permissionname_reason_edit'] = 'Set Reason for edit';
$txt['permissionhelp_reason_edit'] = 'Set if the membergroup is allowed to put the reason for edit their own posts.';
// Reason for editing mod END


You just need to replace the strings between the apostrophes

Hello, thank you very much for your help. Translation works really well


pocttopus

Somehow the mod is not working on 2.0.13 version.  :-\
I don't know how to make it work since Emulate version under Advanced link in listing mods is not working either.


pocttopus

Again... this mod was working fine but suddenly don't work properly.
Even to emulate to 2.0 version is not working again.

Any reason for that and how can I solve the issue!?  :-\


-Rock Lee-

Quote from: pocttopus on June 26, 2018, 07:32:40 AM
Again... this mod was working fine but suddenly don't work properly.
Even to emulate to 2.0 version is not working again.

Any reason for that and how can I solve the issue!?  :-\

It's just supposition but what version of PHP do you use? have you also looked at the error logs?


Regards!

¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

pocttopus

PHP version: 5.6.30

The error log is pretty big and I don't have a clue how to solve it out.  :-\

-Rock Lee-

Quote from: pocttopus on June 27, 2018, 03:09:03 AM
PHP version: 5.6.30

The error log is pretty big and I don't have a clue how to solve it out.  :-\

Try to clean the records and navigate the issues ... with so many mistakes I guess I am not, it can be a conflict but the issue is to know which one.


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

pocttopus

I had cleaned the error log and mod is still no working.  :-[ :-\


jack208

Installed this today on ver 2.0.15. I then hit an issue where I cannot post a reply to any topic. The error log said something about default value in DB.

Database Error: Field 'edit_reason' doesn't have a default valueOnly show the errors from this file File: /mydomain.com/wwwroot/Sources/Subs-Post.phpLine: 1846

The mod creates a new field "edit_reason" in the smf_messages table, but the field is set with the following attributes
- Null = Not allowed
- Default Value = None

After changing the attributes (via phpMyAdmin) to
- Null = Allowed
- Default Value = Null

... posting replies is back to working condition.

Not sure whether it's my hosting's MySQL server setup that defines the Null/Default attributes or is this something the Nibogo can built into his mod codes. Anyway if you face a DB issue around no default values for the edit_reason, this should fix it.

Arantor

It's more that not defining a default used to be OK on MySQL but now it's not.

Kindred

Well, it was not for several MySQL versions. They fixed it with the more recent versions
Сл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

Strict mode is alive and well and continues to function this way, as it should.

The main difference is that a lot of hosts turn it off.

Kindred

true....  but for a few versions my MySQL, it was not alterable - it was always on.
Сл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

Yes, but a lot of hosts are leaving it on because it's the default in MySQL now.

I'd note that if mod authors used the tools available correctly this would not even be a problem.

jack208

Quote from: jack208 on July 01, 2018, 05:23:17 PM
Installed this today on ver 2.0.15. I then hit an issue where I cannot post a reply to any topic. The error log said something about default value in DB.

Database Error: Field 'edit_reason' doesn't have a default valueOnly show the errors from this file File: /mydomain.com/wwwroot/Sources/Subs-Post.phpLine: 1846

The mod creates a new field "edit_reason" in the smf_messages table, but the field is set with the following attributes
- Null = Not allowed
- Default Value = None

After changing the attributes (via phpMyAdmin) to
- Null = Allowed
- Default Value = Null

... posting replies is back to working condition.

Not sure whether it's my hosting's MySQL server setup that defines the Null/Default attributes or is this something the Nibogo can built into his mod codes. Anyway if you face a DB issue around no default values for the edit_reason, this should fix it.

If you have this problem when installing/using this mod - due to the NULL in column issue - then you'll have this same issue if you are uninstalling/re-installing this mod (with existing data in the edit_reason column) for eg after installing a new theme.

1) The installation checks will pass all tests including those on the custom/new themes
2) However when you try to run the install, it'll give you a DB error (below) (this is assuming you have already entered new mesages after installing the mod the first time)

>Data truncated for column 'edit_reason' at row 22594
>File: mydomain.com\wwwroot\Packages\temp\db_reason2.php
>Line: 23

The error is becoz the above script is trying to update the DB with the same no NULL allowed setting for the column.

To resolve this, I amended the db_reason2.php to change the value of 'null' from false to true.

    // Add the new column
$smcFunc['db_add_column'] ('{db_prefix}messages', array(
'name' => 'edit_reason',
'type' => 'tinytext',
'null' => true
));

Advertisement: