Project:Ajax Checklist
Version:6.x-1.0
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I'm using Drupal 6.8, logged in as user 1, posting with an input filter with only the checkbox filter activated. Upon save, node shows list of items with empty checkboxes in front of them, but they are not toggle-able. Nothing happens.

Any help appreciated.

Comments

#1

Give UID1 a role and switch on "update ajax checklists" permission for that role. Right now it only checks that permission and does not auto-allow UID1.

Anton

#2

Thanks for the quick reply. I gave UID1 my admin role and enabled the "update ajax checklists" permission as you recommended, but the checkboxes still show as disabled.

#3

Version:6.x-1.0» 5.x-1.2

I'm having exactly the same problem but with version 5.

#4

Ahkiam, is your Drupal site in a sub directory? If so you may want to check this out:
http://drupal.org/node/247001

I fixed this bug on my site by changing the ajax_checklist.js file so that all references to "/ajaxchecklist/" are changed to "/mysubdirectory/ajaxchecklist/".

#5

I am at version 6.x-1.0 and I can manipulate the checkboxes after which the affected line shortly turns red (somehow indicating that they are probably saving to DB). And the checkbox stays checked. So this looks allright to me.

But when I open the node again. Nothing has saved. And the node is untouched.

I have given my admin user the permission to change/edit the Ajax Checklist. But still to no avail.

Please can anyone point to how do I change the state of the box AND save it to DB?

Thanks

Morten E

#6

Version:5.x-1.2» 6.x-1.0

Hi guys,

I still have the issue of not being able to change the state of my checkboxes. I have given the admin user the permissions he needs. But still no change.

Now I have tested with another Ajax enabled checkbox system (module Brilliant Gallery). And this works. So my Ajax works.

Howcome I see no text in red (saving...) that changes back when the item has been saved to DB.

I have to get this thing working, as we have a big project waiting for the checklist.

Please anyone - Help!

PS I changed the Version of this project back to D6 where it originated from...

Thanks

Morten

#7

Anyone - This is driving me mad.

Please help...

Thanks

Morten

#8

Does noone own this module? I think response is failing. And I would love this functionality on my site.

What can be done to solve above issue?

Thanks

Morten E.

#9

Title:Checkboxes Diabled» Checkboxes Disabled

I spent a little time going through this module, and there are a couple of things that can cause the checkboxes to misbehave. I'm documenting what I found here, to help others in diagnosing problems such as the one excaliburst is having.

First, if the checkboxes appear as "[cb ....", then your node's text isn't being modified by the input filter. Check your input format configuration, check the format selected on your node, and check the filter order within your input format. Subsequent filters can modify the output of previous filters, and this can be hard to diagnose. I found it useful to set up an input format that only applies the AJAX checklist filter, and use this for testing.

Next, if the checkboxes appear, but are disabled (grayed out), the javascript file is probably not attached to the page. View the page source and look for "ajax_checklist.js" in a <script> tag near the top. This needs to be present for the checkboxes to work.

Third, if the checkboxes appear, but their behavior is flaky -- for example, you can check the checkbox, but it doesn't turn red while saving, or if the wrong boxes are checked when you load the page -- it's possible the node id isn't being written to the <form> and <input> tags that define the checkbox. View the page source and look for these tags; the <form> tag should specify 'id="##"', where "##" is a node id; if text appears here, then the token isn't being replaced with the actual node id when the page is rendered. The node id should also appear as the "value=" attribute in the <input> tag that follows the <form> tag.

The upshot is this: the page is well-formed if (1) the .js file is attached, and (2) node ids appear in the <form> and <input> tags for each checkbox.

I made some changes to the module to make sure the .js is attached on the right pages, to make it less likely that other modules will interfere with the node id token replacement, and to let checkboxes work on CCK fields. I've attached a patch. Here's what changed:

  • The node id is placed in the <form> and <input> tags in a preprocess function instead of ajax_checklist_nodeapi(). That seems to let checkboxes work with CCK fields. I changed the token to !ajax_checklist_nid, to look more like the tokens used with the t() function; the old token format was being filtered out by other modules.
  • The .js file is attached to the page in ajax_checklist_nodeapi() in the "alter" operation, and only if the rendered node body contains the token. The means the .js file is loaded only where needed.
  • I added an implementation of hook_filter_tips(), so users can see an example checkbox syntax on node edit forms.
  • Table references in sql queries are "prefixed" (surrounded by curly braces).
  • Some light editing on text.

This is a great module, BTW. Exactly what one of our sites needs -- but also a nice example of what you can do in Drupal. Thanks to AsciiKewl for contributing this!

AttachmentSize
ajax_checklist.module.354302.patch 5.38 KB

#10

Thanks a million jshuster,

Apparrantly I do not see the in my pages sourcecode. What can then be wrong.

When I click the checkboxes the line turns red and looks like it is saving. But it really doesn't save anything.

Any ideas?

Thanks

Morten

#11

Attaching source for the page

AttachmentSize
ajax-checklist.txt 90.6 KB

#12

Hi, Morton,

Something got dropped from your last post; what is it that you don't see in your source code?

The code in ajax_checklist.js changes the checkbox color, and then calls the php function ajax_checklist_save() to do the actual save. It calls the php function by calling a URL that starts with /ajaxchecklist/save/ (followed by the node id, checkbox id, and the new checkbox state).

I'd suggest that you start by making sure that ajax_checklist_save() works. Assuming you're familiar with PHP, try calling this function standalone. You can use the devel module for this, or you can point your browser to the /ajaxchecklist/save/ URL. You can put print functions at the beginning and end of ajax_checklist_save() to make sure it's being called and is working properly.

If ajax_checklist_save() isn't being called, then it's possible the URL that points to this function (/ajaxchecklist/save/...) isn't being found on your site. If the /ajaxchecklist/save/ URL returns a page not found error, then you may have to alter the URLs in ajax_checklist.js to match your site's configuration. That's the problem that's mentioned in comment #4 above.

Unfortunately, I don't know javascript well enough to make sure the URLs that are referenced in the javascript are properly formed. Absent that, you'll need to play around with the code some to make this work -- but my sense is you're close to a solution.

Good luck with it!

#13

I had this same issue with the checkboxes being disabled. My installation was in a subdirectory so the ajax calls were failing. You can check if this is your problem by using Firebug > Net and look at the ajax calls for ajaxchecklist.

I have modified the path in #9 so that it removes entries from the table on node delete and user delete. Note: this module does not handle node revisions, so any changes to the checks are the same for all revisions.

Attached is the patch for js and module files, so apply from your modules directory.

AttachmentSize
ajax_checklist-354302-1.patch 8.01 KB
nobody click here