Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am creating an event-website. It would be nice if scheduler could be set as a widget for a field. When creating a node, they could choose to publish an event from x to y.
Please advise! Thank you for your time & efforts.
Comment | File | Size | Author |
---|---|---|---|
#22 | 1203958-22.scheduler_as_field.patch | 7.5 KB | pfrenssen |
Comments
Comment #1
cmseasy CreditAttribution: cmseasy commented+++
With a field, admins can rearrange scheduler in the node edit field form.
Now, scheduler is almost the last item in vertical tabs: almost hidden for users.
When you make scheduler required than users have to find it, mostly they dont, and hit the node submit without date settings. They don't understand the error. Placing scheduler in a "understandable" workfow for the nodeform is a great +++.
Comment #2
inforeto CreditAttribution: inforeto commented+1 to this, it was fine back in d5-d6 but as of d7 the node type building has new customization features.
Starting with the vertical tabs, which it'd be great if could be open by default.
Then the weight, but for this it'd be best to make it a full field so you can arrange it in the manager.
Comment #3
zhgenti CreditAttribution: zhgenti commentedHello,
Agree with previous commenters, it would be great to have as a field. Not necessary as usual field, but may be extra field like node Title. Whatever is easier to implement.
Thanks
Comment #4
AaronELBorg CreditAttribution: AaronELBorg commentedI just created a patch to show 'Scheduling Options' apart from Vertical Tabs. This patch will also allow a user to set a weight for 'Scheduling Options' so that they aren't buried at the bottom after removing them from the Vertical Tabs display. (Note: the default is to show things in Vertical Tabs just as things are currently.)
This patch also adds in one more config option: the ability to have a publish-on date that occurs in the past. I'm well aware that this issue didn't include this request but if your end-user is your average-joe-type-non-technical-person and you want them to be able to schedule nodes for publishing and unpublishing as easily as possible, it seems somewhat slicker to have both of those fields filled out rather than explaining to them that they only need to fill out the unpublish-on field with an error message. Also, if these types of users are your bread-and-butter (so to speak), one wants to streamline the node-creation process as much as possible. Throwing a 'Publish-on field must occur in the future' error is a roadblock that I'm not convinced absolutely needs to exist. (I could be swayed otherwise.) Again though, the default is to NOT allow this behaviour so it's business as usual from the get-go.
Comment #5
AaronELBorg CreditAttribution: AaronELBorg commentedOh yeah......since this is my first "big" patch (one that affects more than one file), I wasn't too sure how to go about the db update part of things. So currently, in order for this patch to work, you'll need to disable and uninstall/reinstall scheduler. So obviously, installing this on a live site might not be the best decision. If you're feeling brave, however, (and you're doing this on a test site) you could easily increment the update number from "6101" to "6102" (in scheduler.install) and run the update at /update.php.
Again though, this probably needs testing so please tread lightly.
Comment #6
Eric-Alexander Schaefer CreditAttribution: Eric-Alexander Schaefer commented@AaronElBorg Could you please post separate patches for the different changes (vertical tab option, publishing times in the past)?
Comment #7
jonathan1055 CreditAttribution: jonathan1055 commentedYes, the vertical tab vs setting as a field is a new idea, worth investigating.
Publishing time in the past has appeared in many previous posts, and will require a great deal of planning and co-ordination if changed, so they must be separate patches. Just include the tab vs field patch here. Can you also show a couple of screen shots, so we can see more clearly the results.
Thanks
Comment #8
puddyglumHere's the vertical tab / separate field patch from #4.The patch is missing the .js file. I can't seem to figure out how to add the file so I can use diff
Comment #9
jonathan1055 CreditAttribution: jonathan1055 commentedHi,
I think your patch has included some unintended changes, maybe you diff'd against an older version than the latest dev? There should be no changes to the lightweight_cron menu call, nor to scheduler_list_access_callback()
Jonathan
Comment #10
puddyglumThis one should work much better. Has the .js file and is committed against the right branch.
Comment #11
idflood CreditAttribution: idflood commentedThe patch in #10 works well but the javascript part is a little wrong. One important thing in d7 is that javascripts should not use the $(document).ready function since it won't work if the settings appear in a modal, or other cases. The recommended way is to use the behaviors: http://drupal.org/node/756722#behaviors
But looking at this, the javascript part is not needed. The form #states api can handle this really easily: http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.ht...
Here is a new patch with only the js removed and the #states added.
Comment #12
gaheinrichs CreditAttribution: gaheinrichs commentedHello,
Is there a way to manage the field. I am using Fieldgroup module to specify a group to each field. I will like to set scheduler inside a group.
Thanks
Comment #13
noslokire CreditAttribution: noslokire commented#11 works for me
Comment #14
ace11 CreditAttribution: ace11 commentedIs there a way to schedule one field in node?
So that if I have for example 5 different fields in node. And I need to set different publishing schedule for every field. Is it possible?
Comment #15
Pat Redmond CreditAttribution: Pat Redmond commentedace11 and gaheinrichs , you should open a new ticket rather than attaching a different question to another topic.
As far as I am aware, it isn't possible to publish fields. The node is published or unpublished. The fields are attached to the node.
The only way I can think of creating the functionality you mention would make use of the entity reference module to link several nodes to a parent node.
Comment #16
frobI might re-roll this as I would like this functionality.
Comment #17
jonathan1055 CreditAttribution: jonathan1055 commentedThanks frog that would be good. Now that we have a new co-maintainer lots of patches have been committed in the last few weeks and we have a new 1.1 release.
When you've done the changes, can you also attached a screen shot so we can see how it might look if using the new layout? thanks.
Jonathan
Comment #18
jonathan1055 CreditAttribution: jonathan1055 commentedI've reviewed the patch in #11.
Here is the Scheduler settings tab with existing patch
Scheduler settings tab with new patch
Example of Scheduler options displayed as a separate fieldset
New patch against 7.x-1.1+20
Jonathan
Comment #19
pfrenssenInstead of letting the user set a weight to determine the position of the Scheduler options we should allow to position the field by using the drag-and-drop interface from Field UI. We would lose the possibility to set the weight of the vertical tab, but this can be changed easily with a simple form alter, or by using a contrib module that specializes in this (eg Display Suite, Field Group, Renderable Elements, ...). I checked all comments in this issue but nobody requested reordering of the vertical tabs, so I guess it's fine to remove it. I suppose if you want to reorder the tabs, you would want to reorder several of them instead of only the Scheduler tab, and then you end up using one of those contrib modules anyway.
I've updated the patch with the following changes:
I will assign this to myself for writing tests. I just wanted to get this patch out already to get some feedback.
Comment #20
jonathan1055 CreditAttribution: jonathan1055 commentedYes it is better to have the draggable fields. That thought had crossed my mind. It is interesting how each new version of a patch improves on the previous one, and we might not get to the final enhanced version had we not made the intermediate steps. I built on the work done by three previous contributors, made significant changes, and you have done even more.
Interesting that hook_content_extra_fields() had been defined, as I cannot see that function in either the D6 or D7 api documentation. hook_field_extra_fields() was new for D7, so maybe it started out in the initial D7 alpha/beta version as hook_content_extra_fields() but got renamed?
I wanted to use the vertical patch weight, but I can implement that in my sites custom module. I've tested the patch, all works ok. Thanks for the other minor improvements too.
Jonathan
Comment #21
pfrenssenYeah this is the great strength of open source, every small change is potentially looked at by many people, and the end result is much better :)
Probably hook_content_extra_fields() was supplied by the CCK module in Drupal 6, which was reworked to become the Field module in D7.
Comment #22
pfrenssenAdded a test.
Comment #23
jonathan1055 CreditAttribution: jonathan1055 commentedFor those who would like to alter the position of the scheduler vertical tab, now that this functionality is not in the latest patch, here is an example of how it can be done in your custom hook_form_alter()
Jonathan
Comment #24
jonathan1055 CreditAttribution: jonathan1055 commentedNice work. This is good and ready to go.
Comment #25
pfrenssenAwesome! This has been committed: 7dbc925. Thanks everybody!
Comment #26
jonathan1055 CreditAttribution: jonathan1055 commentedGood team effort.
Now we will see if the Drupal.org D7 upgarde dev packaging and release process works. There have several issues relating to it in the QA list.