As discussed in IRC, the "Content and comments" tab (global settings) and "Points Awards" tab (content type settings) have gotten pretty lengthy. As a result, they are somewhat confusing (because so many settings are lumped together).

So we should really separate content settings from comment settings in separate vertical tabs...

Global tabs:
Content
Comments

Content type tabs:
!Points for content
!Points for comments

Unless you think we should use the same vertical tab names between global and content type settings?

To do this, we'll also need to divide the following settings into separate settings for content and comments:

"Only award kudos for published nodes and comments."
"Deduct kudos when the content or comment author changes."
"Deduct kudos when content or comments are deleted or unpublished."

--Ben

CommentFileSizeAuthor
#1 split.patch20.36 KBBerdir
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Status: Active » Needs review
FileSize
20.36 KB

Ok, here is a patch:

- Order is now Content, comments, revision, visits. Note that content access in the middle, I will fix when updating the tab title/summary of that

- Duplicated all settings for comments, including enabled flag. You will need to re-test all these settings, to make sure that I correctly re-named them everywhere. I think we don't have any tests yet for comments.

- Also added an uninstall hook that removes all these variables. You could test that by re-installing (disable, uninstall, install again) the module and then check if all settings are back to their default values. No data will be removed like transactions, just settings.

BenK’s picture

The patch is working very well. All of the functionality is working properly both for content and comments. I disabled, uninstalled, and installed the module and confirmed that all settings were returned to their defaults (and no transaction data was lost). I just noticed a few small things:

A. At the content type level, under the "!Points for comments" vertical tab, if the functionality is disabled (Enabled is unchecked) then the Points and Points category fields are nonetheless still visible. Instead, they should be hidden (as the the case for the content vertical tab).

B. On the global settings page, there is an identical checkbox problem under both the "Content" and "Comments" vertical tabs. Basically, if "Deduct kudos when the content author changes" is unchecked, then after saving the content "Deduct kudos when content is deleted or unpublished" will also appear to be unchecked (even though it is functioning like it is still checked). The problem in functionality occurs when you save again... this time "Deduct kudos when content is deleted or unpublished" will both appear unchecked and function like it is unchecked.

The opposite will happen if you uncheck "Deduct kudos when content is deleted or unpublished" and then save. In this case, "Deduct kudos when content is deleted or unpublished" will still appear to be checked even though it is properly functioning as if it is unchecked.

So it appears that the current "Deduct kudos when the content author changes" setting is controlling the visible state upon page load of the "Deduct kudos when content is deleted or unpublished" setting.

C. We currently have two strings that use a unique format:

Content was unpublished: %title.
Content was published: %title.

But we could change this to match what we did for UP Page Visits ("A user visited %title.) In this case it would read:

A user unpublished %title.
A user published %title.

Just an idea... what do you think?

That's it for me... this is very close to being done!

--Ben

BenK’s picture

Status: Needs review » Needs work
Berdir’s picture

Status: Needs work » Fixed

A. Fixed

B. Fixed. This was not a bug introduced by this patch but already existed before.

C. Hm, not sure. In contrast to access, it is not true here that the content was published/unpublished by someone else. Could be, but it could also be yourself. Feel free to create a separate issue about this though.

Decided to go ahead and commit this, the fixes are trivial.

BenK’s picture

Great to get this committed! :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.