Closed (outdated)
Project:
Domain
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
22 Feb 2010 at 15:12 UTC
Updated:
3 Sep 2024 at 19:01 UTC
Jump to comment: Most recent
I think that the checkbox logic needs to be put into one place and hidden behind a function.
yonas # find domain | xargs grep 'Cannot pass zero in checkboxes'
domain/domain_content/domain_content.module: // Cannot pass zero in checkboxes, so these are converted from -1.
domain/domain_content/domain_content.module: // Cannot pass zero in checkboxes.
domain/domain_content/domain_content.admin.inc: // Cannot pass zero in checkboxes, so these are converted from -1.
domain/domain.module: // Cannot pass zero in checkboxes.
domain/domain.module: // Cannot pass zero in checkboxes.
In other words, that should only show up once. I've hit problems with checkboxes a few times already while using other domain modules.
Patches welcome. The 'cannot pass zero in checkboxes' is a core limitation that we have to work around, and the new form style (which allows separate formats) hasn't been consolidated. That should be spun off as a separate issue. The problem there is reconciling the form names and a few other minor discrepancies among each usage.
-- by agentrickard
Comments
Comment #1
agentrickardIt's in many more places than this. See also Domain Views and Domain CTools.
This might have to wait for the D7 release, in which core will have fixed the underlying issue.
Comment #2
agentrickardOr do you simply want a -1 > 0 converter function? I am thinking about standardizing this type of construct:
Comment #3
fizk commentedWhen D7 core fixes the underlying issue, will it be backported to D6?
What do you mean by standardizing the construct? Basically we should put that repeating block of logic/code into one function, and have other modules update accordingly. Also, no one else should know about this -1 <==> 0 issue, just one function.
Other modules can always build their own form to display domains however they wish, but if they simply want the "default" selection form, it should be as easy as calling
domain_content_add_form_widget(&$form);Comment #4
agentrickardRight, I just haven't gotten around to that. But that is too simple, because the name of the $form element array differs, so you would have to pass that in some way, or do:
Though I don't know if you need to pass $form here.
That doesn't solve the conversion problem on submit, either, which is why I haven't bothered.
Comment #5
agentrickardThis has to be API cleanup for D7.
Use http://api.drupal.org/api/function/hook_element_info/7
Comment #6
fizk commentedWhat's wrong with http://api.drupal.org/api/function/hook_elements/6 in D6?
Comment #7
agentrickardD6 version is closed to API changes and bugfix only. See #781422: D7 Sprint roadmap.
Comment #8
dqdI'll close this issue due to inactivity for 14 years and upcoming EOL of Drupal 7 in January 2025. While the project's version for Drupal 7 will surely keep providing support for security issues and website breaking bug fixes for Drupal 7, we should try to minimize the open issues for Drupal 7 in the queue as much as possible. A big thanks around for the report and all the efforts in here. Feel free to re-open if you can provide a fix or found an additional related problem which increases the issue priority.