Closed (fixed)
Project:
Mollom
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
18 May 2010 at 00:53 UTC
Updated:
2 Nov 2017 at 16:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedComment #2
dries commentedThe main Mollom settings page doesn't display such a message either. It is probably a good idea to apply this, or another pattern, across the two tabs.
The truth is that the warning message does not prevent the errors from happening. After all, you could ignore the message and still use the blacklist form. A better solution _might_ be to hide the tabs but I'd need to revisit the code to figure out if that can be implemented efficiently.
Thoughts?
Comment #3
gábor hojtsyYou can just use an access callback to the tabs. Not sure that hiding the tabs is the best UX wise though.
Comment #4
dries commentedWorking on this. Assigning to myself.
Comment #5
dries commentedSee #415014-31: Add an in-module developer mode toggle as I incorporated these changes into the patch in #415014. This made sense to do because we also needed to explain that developer mode was enabled. The approach is identical to the mechanism required to mention that keys still need to be installed.
Comment #6
dries commentedCommitted a better version of this patch to CVS HEAD along with #415014: Add an in-module developer mode toggle. Thanks!
Comment #8
sunRe-opening, since I discovered the changes for this issue only now:
http://drupalcode.org/viewvc/drupal/contributions/modules/mollom/tests/m...
I think this change invalidated the intended logic of the watchdog message assertion. As the variable name
$no_fail_expectedimplies, we need to assert that no severe watchdog messages were logged. And vice-versa, i.e., if we expect a failure, then there has to be one. Effectively, I think that this change broke the intention of a couple of our tests.However, I'm also starring on these diff lines for about 20 minutes already, trying to think through all cases. Maybe I'm wrong, but it looks like if we're passing FALSE for $no_fail_expected, then we won't ever assert a failure, as the initial condition is plain FALSE already.
http://drupalcode.org/viewvc/drupal/contributions/modules/mollom/mollom....
1) minor: Wrong PHPDoc.
2) Could use strpos() instead of that many + slow arg() invocations. Also, empty($_POST).
3) Why do we invoke this status check and message on all admin/reports* pages?
4) I'd prefer to display the testing mode message only on pages containing a (protected) form. And, more importantly, I'd prefer to display this message regardless of user permissions. If your site's users are complaining about not being able to submit forms, and at the same time, mentioning a warning message about a "Mollom testing mode", you immediately know what's going on.
5) hook_requirements() had the benefit of Drupal actually reporting a configuration error, automatically. There are contributed modules that periodically check requirements and automatically send an e-mail if something happens to be wrong. Properly debugging Drupal is a problem space on its own, and the status report page is at least the first address users should be looking for warnings or errors if something does not work. From a more distant perspective, it is counter-productive to replace the requirement checks there with arbitrary error messages elsewhere.
This also happily translates into: "I don't like code in hook_init()."
--
Effectively, I'd suggest to roll back the removal of hook_requirements(), and rather execute mollom_requirements() on those particular page callbacks as well as mollom_form_alter() [for protected forms].
Comment #9
dries commented2) Could use strpos() instead of that many + slow arg() invocations. Also, empty($_POST).
Sure.
3) Why do we invoke this status check and message on all admin/reports* pages?
Probably an oversight.
4) I'd prefer to display the testing mode message only on pages containing a (protected) form.
Works for me.
5) hook_requirements() had the benefit of Drupal actually reporting a configuration error, automatically.
Works for me.
Comment #10
sunProperly extracting and reverting the changes from the merged commit is quite time-consuming. Attached patch is contains the reversely applied changes, mixed into the current code.
Before continuing here, I think we need to clarify the goal. Let me explain my strategic point of view:
It may be true that Drupal core's behavior for checking and re-ensuring requirements is a bit weak and/or memory intensive. However, the proper place to improve those checks would be Drupal core then.
Since we are required to check our requirements on most of our admin pages, we are forced to
Due to aforementioned weak implementation and performance reasons, I guess we're going to do 1.
Effectively, this would mean:
This function will be invoked manually on our administrative pages. Roughly, it simply checks the status first, and if that is not ok, we load mollom_requirements() to use it as dedicated UI error message generator.
While we could just move mollom_requirements() from mollom.install into mollom.module at this point in time, we would definitely face this problem space again, once we need to add a pre-installation requirement.
Comment #11
sunComment #12
dries commentedThe requirements handling in Drupal did not suffice and we still got a fair amount of people that did not know what to do after installing the Mollom module. The Mollom settings page is hidden and it is not natural to navigate to it after someone installed Mollom -- we needed to better guide new users to the Mollom settings page.
The problem is not unique to Mollom, many other modules have the same problem. The requirements page might be the best we have today, but let's recognize that it is not a good solution relative to the post installation experience. You don't present people an error after enabling a module; you need to guide them in a wizard-style way. Error messages make for a poor and scary experience. ;-)
Anyway, that is a bit of a rant but it might provide some additional context and background. ;-)
I only skimmed the patch in #11 and it doesn't look like it reverts the UX improvements we've made to guide people to the Mollom settings page when necessary. Let's wait for the test bot -- is it still on?
Additional thoughts? Additional ideas to improve the new user experience?
Comment #13
sunNote: We're definitely working around a shortcoming of Drupal core here. A very important task for D8 should definitely be to add an admin_guide module to core. I might as well invent that + add it to my package elsewhere. Anyway:
Didn't update the tests accordingly, so tests will likely fail, but I'm relatively happy with attached patch. We're reverting to hook_requirements(), and we're using _mollom_status() to programmatically and quickly check the configuration status on administration pages. We only link to the settings page, if the current user is able to access it. Regardless of user permissions, all users will see the testing mode warning. But only admins will get a link to the settings page. Details are documented in-code.
Additionally, I stumbled over some more hard-to-grok behaviors and expectations that are contained in the module's code for a long time already. Added docs for those bits as well.
Lastly, some of the added @todos are debatable. You may want to use Dreditor to comment on them.
Comment #15
sunWorked on those tests.
Comment #16
suns/developer mode/testing mode/
Comment #18
sunRe-rolled against HEAD.
Comment #19
sunThese two expectations are not covered by tests currently.
Additionally, I'm not sure whether we want to re-verify the keys/configuration upon every visit of the settings page, but it might make sense.
Powered by Dreditor.
Comment #20
dries commentedAdditionally, I'm not sure whether we want to re-verify the keys/configuration upon every visit of the settings page, but it might make sense.
We want to. It gives us an opportunity to update the site's server list, and in the future, to send module information to Mollom.
Comment #21
dries commentedReviewed the patch and it looks good. I've a couple of minor thoughts about some of the @todos but they are very minor.
In general, the patch has a fair amount of @todo's so I'm wondering: would you want me to commit this now or are you still working on those @todos?
Comment #22
sunFixed + resolved in this patch.
Those lines are gone, as we are re-checking the module's configuration status upon every visit of the settings form now.
I think that this entire issue + patch more or less destroys the option of being able to install + prepare/configure without entering API keys. I've removed this @todo for now; separate and entirely different issue.
Just shortened this @todo for now. We'll implement a fast cache for this over in #849340: Cache mollom_form_load() and query in mollom_form_alter()
Removed this @todo for now. I guess it makes sense this way in the end. :)
Heavily clarified this comment as well. Thinking more and more about this single @todo, I almost guess that resolving this single one would have resolved many other issues related to installation and status handling... :)
Please wait for patch coming back green.
Powered by Dreditor.
Comment #24
sunLOL
Comment #26
sunThis one should pass.
Comment #27
dries commentedCommitted to CVS HEAD. Thanks.
Comment #28
sunDo we want to backport this?
Comment #30
sunThat second patch is a tiny follow-up fix for D7. Should be re-tested after committing the D6 patch.
However, note that we have 0 (zero) passes again, which means that no tests were executed. Requesting a re-test.
Comment #31
sun#28: mollom-DRUPAL-6--1.requirements.28.patch queued for re-testing.
Comment #32
sun#28: mollom-DRUPAL-6--1.requirements.28.patch queued for re-testing.
Comment #33
sun#28: mollom-DRUPAL-6--1.requirements.28.patch queued for re-testing.
Comment #34
sun#28: mollom-DRUPAL-6--1.requirements.28.patch queued for re-testing.
Comment #35
sun#28: mollom-DRUPAL-6--1.requirements.28.patch queued for re-testing.
Comment #36
sunBogus "0 pass(es)".
Comment #37
sunIs it perhaps caused by the patch filename...?
Comment #38
dries commentedStill 0 passes. Odd.
Comment #39
sunRunning tests locally revealed an exception, but I doubt that an exception is able to trigger this odd behavior.
Comment #41
sun#39: mollom-DRUPAL-6--1.requirements.39.patch queued for re-testing.
Comment #42
sunLooking more closely at the failing test results, it seems like tests are returning early due to a fatal error. Drupal 6 does not load .module files during installation. When manually running tests, this seems to work somehow. So PIFR seems to install modules differently... (?) Let's give this a try.
Comment #43
sun#42: mollom-DRUPAL-6--1.requirements.42.patch queued for re-testing.
Comment #44
sun#42: mollom-DRUPAL-6--1.requirements.42.patch queued for re-testing.
Comment #45
dries commentedThe bot is still unhappy. :/
Comment #46
sunLet's try another variant then. Moved the drupal_load('module', 'mollom') into mollom_requirements().
Comment #47
sun#46: mollom-DRUPAL-6--1.requirements.46.patch queued for re-testing.
Comment #48
sunSo what happens if we remove that entire code from hook_install()...?
Comment #49
sunEliminating major parts of the patch... just to see.
Comment #50
sunBack to #39.
Comment #52
sunNow that the testbot seems to work again, let's finally port and commit this one. Please wait for the bot to come back green (and >0 passes).
Comment #53
sunDon't halloo till you're out of the wood! Had to re-test 3 times..., but finally passes now.
Comment #54
dries commentedCommitted to CVS HEAD. Thanks.