Closed (fixed)
Project:
Entity Registration
Version:
7.x-1.x-dev
Component:
Registration Core
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2012 at 04:27 UTC
Updated:
27 Jun 2014 at 21:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dpiAttached patch adds some foundation for creating settings when an entity is created.
A default settings form should probably be added on each registration field instance or registration type.
A registration settings update hook has also been put in.
Comment #1.0
dpiadd related issue
Comment #2
levelos commentedThanks @dpi. I don't think registrations should be enabled by default when a new entity is created but before a user has had a chance to configure settings. It'd make more sense if we had a default settings form at the field level.
Comment #3
drewbe121212 commentedAgreed with levelos here.
Just as a simple use case, we have an 'event calendar' that has the registration entity tied to it. Most of the events aren't registration based, only a few. A configuration option would be wonderful, but to force it on by default without an option to disable this seems a bit backwards.
Comment #4
dpiI wasn't saying out of the box Registration should make them open. Rather, in some use-cases it may make sense for an admin to set his site defaults to open.
The patch is incomplete, the defaults listed in there should be substituted by the options set by the admin.
I should have made it clearer, sorry.
Comment #5
drewbe121212 commentedIt was mostly my misunderstanding. I am not completely familiar with the new version of this module yet.
I may take a crack at this update this weekend. I need more exposure to entity's and how they are all tied together.
To me, it makes sense that we have these config settings on the manage registration %entity% edit page. The defaults... to the defaults should be:
Enabled : 0
Capacity : 0
Reminder : 0
Reminder Template : [empty string]
Allow Multiple Registrations : 0
From address : [admins email]
These defaults will then propagate to the specific add/edit content registration entity.
Thoughts?
Comment #6
mjross commentedI'm new to all of this, but it seems to me that the default value for Enabled should be 1 -- similar to the way that a new node is, by default, set to published. In most cases, when someone creates a new registration entity, it is one that he wants to be immediately available for registrations, and not one to be enabled at some point in the future. Furthermore, if the entities are being created by non-admin site users, they may not even be aware that they have to also enable the entity, and otherwise no one can register.
Comment #7
levelos commented@dpi, great start. I agree that the idea place to store these is at the field instance settings level, which can obviously be overridden per entity. Interested in flushing it out a bit more?
Comment #8
dpi@mjross Like node.module's published option, we should be giving administrators a chance to change the default value for new content.
@levelos Patch coming soon. It would be great to get some feedback on the 'needs review' issues in the queue as well before too many incompatible patches are submitted.
Comment #9
levelos commentedAgreed. I took a swipe at a number of them this morning.
Comment #10
mstef commented+1
Comment #11
jpontani commentedJust a matter of philosophy, but would it not be better to just have the hook_registration_update_entity_settings return an array of settings that gets merged with the array in the base function? This way module developers wouldn't have to write to the database and have their own settings just get overwritten since the base function doesn't take into account changes in the settings in between function call and actually writing them to the DB.
IE: Default settings set status to 0, registration_update_entity_settings is called, triggers hook functions which update status to 1, registration_update_entity_settings is done with hooks, merges settings into DB which then set status back to 0.
Comment #12
attiks commentednew patch, hook is called from inside the insert
Comment #13
dpiNeed a defaults UI. I think that is the current task.
Comment #14
attiks commentedYou mean a UI for admin/structure/registration_types/manage/ so the defaults can be set? If so, I will have a look at it later, my patch just added all settings and uses a hook to alter them.
Comment #15
jelle_sThis patch adds a 'Default registration settings' fieldset to the field instance form.
These settings will be the default for all entities of the bundle the field is attached to.
Comment #16
jelle_sThis time without whitespace errors...
Comment #17
attiks commentedI adapted the patch so the fieldset is open by default
Comment #18
dpiFinally got around to posting my implementation.
Comment #19
dpiWrong diff, fixed.
Comment #20
attiks commented@dpi, so the difference with our implementation is:
Comment #21
dpiI have chosen to alter the field settings form instead of adding field settings because I cannot append form elements inside hook_field_instance_settings_form efficiently and have validate and submission functions.
Using Drupal variables is a side effect of not being able to use the instance settings form.
I approve of this. I even had it in the the earlier patches. Generic registration settings implementation are a higher priority right now.
D.R.Y ;)
Notably, there is a generic validation and submission function common to both the entity and defaults form. Both the entity and defaults implement their own submission function to deal with where to put the settings data.
Comment #22
dpiReroll against latest changes.
Comment #23
dpiWhat needs to be done here?
Comment #24
attiks commentedI'm good with storing the settings inside variables, although personally i prefer my approach. Only thing i would like to see in your patch is the addition of our hook. And then i think this can be committed?
Comment #25
dpiOf course.
I fear rerolling patches is a futile effort when maintainers are not giving feedback.
I'm not complaining, but if a beta is truly expected this month, then this issue should be considered a blocker.
Comment #26
levelos commentedSorry for the delay gang. I took inspiration from both of you and implemented in 8b4ceb36a2a2222b0afc589afb375a7f2fae73e0. Quite a number of changes in there, so some review/testing would be great. @dpi, if/when you get around to it, probably a great candidate for a unit test.
Comment #27
dpiComing back to #21, how do you intend to validate the settings form?
Comment #28
levelos commented@dpi, just pushed a solution. Ref: c6eaa1ecbbb3706eb7c7e929d88d9ca4c8870081.
Comment #30
tomdisher commentedI think this is the appropriate place for this, if not please excuse me.
After turning on the current -dev to try testing the default settings I get
Comment #31
dpiPlease post new issues in the future.
#1564972: Upgrade from Alpha5 to Beta2 returns a database error when running update.php
Comment #31.0
dpiwrong number :(