checkbox/grid id serialization

Phil Marneweck avatarPhil Marneweck created an issue

Weblocks (checkbox/grid) expects an integer as the key of the data object. I looked into changing this behavior in the following function

(defun/cc dataseq-operations-action (obj &rest args)
  (declare (ignore args))
  (dataseq-clear-selection obj)
  (loop for i in (request-parameters)
     when (string-starts-with (car i) "item-")
     do (dataseq-select-item obj 
              (parse-integer  (substring (car i) 5))))
  (loop for i in (append
		  (dataseq-item-ops obj)
		  (dataseq-common-ops obj))
        when (member 
                          (attributize-name (car i)) 
                     :key (compose #'attributize-name #'car)
                     :test #'string-equal)
          do (funcall (cdr i) obj (dataseq-selection obj)))
  (dataseq-clear-selection obj))

If the parse-integer is removed the code does not crash any more but attributize mangles the id value and by the time it gets back to the store to be used for deleting an item it is no longer recognizable.

This seems to be the only place that and integer is required so if the attributize can be changed to not mangle the id completely this can be sorted out.

Comments (0)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.