3/6/12

Re: [development] resetting a form

Oh, NM, I've just seem an example in examples.module that I'd overlooked...

On 7 March 2012 12:37, Si Hobbs <simon@hobbs.id.au> wrote:
> Part of my problem is not being able to define my own "delivery
> callback" in hook_menu because my form is in a block.
>
> If I cannot have my own "delivery callback", I'm struggling to work
> out how to return my own series of ajax_comment_X() in my
> ajax_callback. I can only seem to return a renderable array, or some
> static content.
>
> Si
>
>
>
> On 7 March 2012 12:26, Si Hobbs <simon@hobbs.id.au> wrote:
>> Oh yes, I'm talking about Drupal 7. I used to do all this with ctools
>> in Drupal 6.
>>
>> Yes it works if I clean up the $form_state['values']. It feels a
>> little weird but thanks heaps for that.
>>
>> Simon
>>
>>
>> On 7 March 2012 12:12, David Metzler <metzler.dl@gmail.com> wrote:
>>> Tools are substantially different for the based on drupal 6 vs. 7.   Could you specify the version?
>>>
>>> Is there a reason not to simply alter $form_state['values'] as part of your submit handler?   I would've done it the other way around.  Imbed the thank you message in the form as a markup item, rather than trying to put it outside of the form.
>>>
>>> On Mar 6, 2012, at 4:57 PM, Si Hobbs wrote:
>>>
>>>> Hi
>>>>
>>>> I am doing an ajax callback, and I want to return a fresh version of a
>>>> form as content. This is after the form has successfully submitted.
>>>>
>>>> So instead of something like:
>>>>  return 'Thanks for your submission';
>>>> Which works, I want to do:
>>>>  return 'Thanks for your submission' . drupal_render(drupal_get_form('foo'));
>>>>
>>>> However when I get that that form, it is not fresh. The form system
>>>> reprocesses the form, re-runs the submit handler, and returns a form
>>>> with the $form_state['values'] all populated.
>>>>
>>>> So, I've been trying to work out how to reset the form. For example,
>>>> this sort of thing doesn't successfully clear the form:
>>>>
>>>>    cache_clear_all('form_' . $form_state['values']['form_build_id'],
>>>> 'cache_form');
>>>>    cache_clear_all('form_state_' .
>>>> $form_state['values']['form_build_id'], 'cache_form');
>>>>    drupal_static_reset('drupal_retrieve_form');
>>>>
>>>> Thanks for any tips.
>>>>
>>>> Simon
>>>

Re: [development] resetting a form

Part of my problem is not being able to define my own "delivery
callback" in hook_menu because my form is in a block.

If I cannot have my own "delivery callback", I'm struggling to work
out how to return my own series of ajax_comment_X() in my
ajax_callback. I can only seem to return a renderable array, or some
static content.

Si

On 7 March 2012 12:26, Si Hobbs <simon@hobbs.id.au> wrote:
> Oh yes, I'm talking about Drupal 7. I used to do all this with ctools
> in Drupal 6.
>
> Yes it works if I clean up the $form_state['values']. It feels a
> little weird but thanks heaps for that.
>
> Simon
>
>
> On 7 March 2012 12:12, David Metzler <metzler.dl@gmail.com> wrote:
>> Tools are substantially different for the based on drupal 6 vs. 7.   Could you specify the version?
>>
>> Is there a reason not to simply alter $form_state['values'] as part of your submit handler?   I would've done it the other way around.  Imbed the thank you message in the form as a markup item, rather than trying to put it outside of the form.
>>
>> On Mar 6, 2012, at 4:57 PM, Si Hobbs wrote:
>>
>>> Hi
>>>
>>> I am doing an ajax callback, and I want to return a fresh version of a
>>> form as content. This is after the form has successfully submitted.
>>>
>>> So instead of something like:
>>>  return 'Thanks for your submission';
>>> Which works, I want to do:
>>>  return 'Thanks for your submission' . drupal_render(drupal_get_form('foo'));
>>>
>>> However when I get that that form, it is not fresh. The form system
>>> reprocesses the form, re-runs the submit handler, and returns a form
>>> with the $form_state['values'] all populated.
>>>
>>> So, I've been trying to work out how to reset the form. For example,
>>> this sort of thing doesn't successfully clear the form:
>>>
>>>    cache_clear_all('form_' . $form_state['values']['form_build_id'],
>>> 'cache_form');
>>>    cache_clear_all('form_state_' .
>>> $form_state['values']['form_build_id'], 'cache_form');
>>>    drupal_static_reset('drupal_retrieve_form');
>>>
>>> Thanks for any tips.
>>>
>>> Simon
>>

Re: [development] resetting a form

Oh yes, I'm talking about Drupal 7. I used to do all this with ctools
in Drupal 6.

Yes it works if I clean up the $form_state['values']. It feels a
little weird but thanks heaps for that.

Simon


On 7 March 2012 12:12, David Metzler <metzler.dl@gmail.com> wrote:
> Tools are substantially different for the based on drupal 6 vs. 7.   Could you specify the version?
>
> Is there a reason not to simply alter $form_state['values'] as part of your submit handler?   I would've done it the other way around.  Imbed the thank you message in the form as a markup item, rather than trying to put it outside of the form.
>
> On Mar 6, 2012, at 4:57 PM, Si Hobbs wrote:
>
>> Hi
>>
>> I am doing an ajax callback, and I want to return a fresh version of a
>> form as content. This is after the form has successfully submitted.
>>
>> So instead of something like:
>>  return 'Thanks for your submission';
>> Which works, I want to do:
>>  return 'Thanks for your submission' . drupal_render(drupal_get_form('foo'));
>>
>> However when I get that that form, it is not fresh. The form system
>> reprocesses the form, re-runs the submit handler, and returns a form
>> with the $form_state['values'] all populated.
>>
>> So, I've been trying to work out how to reset the form. For example,
>> this sort of thing doesn't successfully clear the form:
>>
>>    cache_clear_all('form_' . $form_state['values']['form_build_id'],
>> 'cache_form');
>>    cache_clear_all('form_state_' .
>> $form_state['values']['form_build_id'], 'cache_form');
>>    drupal_static_reset('drupal_retrieve_form');
>>
>> Thanks for any tips.
>>
>> Simon
>

Re: [development] resetting a form

Tools are substantially different for the based on drupal 6 vs. 7. Could you specify the version?

Is there a reason not to simply alter $form_state['values'] as part of your submit handler? I would've done it the other way around. Imbed the thank you message in the form as a markup item, rather than trying to put it outside of the form.

On Mar 6, 2012, at 4:57 PM, Si Hobbs wrote:

> Hi
>
> I am doing an ajax callback, and I want to return a fresh version of a
> form as content. This is after the form has successfully submitted.
>
> So instead of something like:
> return 'Thanks for your submission';
> Which works, I want to do:
> return 'Thanks for your submission' . drupal_render(drupal_get_form('foo'));
>
> However when I get that that form, it is not fresh. The form system
> reprocesses the form, re-runs the submit handler, and returns a form
> with the $form_state['values'] all populated.
>
> So, I've been trying to work out how to reset the form. For example,
> this sort of thing doesn't successfully clear the form:
>
> cache_clear_all('form_' . $form_state['values']['form_build_id'],
> 'cache_form');
> cache_clear_all('form_state_' .
> $form_state['values']['form_build_id'], 'cache_form');
> drupal_static_reset('drupal_retrieve_form');
>
> Thanks for any tips.
>
> Simon

[development] resetting a form

Hi

I am doing an ajax callback, and I want to return a fresh version of a
form as content. This is after the form has successfully submitted.

So instead of something like:
return 'Thanks for your submission';
Which works, I want to do:
return 'Thanks for your submission' . drupal_render(drupal_get_form('foo'));

However when I get that that form, it is not fresh. The form system
reprocesses the form, re-runs the submit handler, and returns a form
with the $form_state['values'] all populated.

So, I've been trying to work out how to reset the form. For example,
this sort of thing doesn't successfully clear the form:

cache_clear_all('form_' . $form_state['values']['form_build_id'],
'cache_form');
cache_clear_all('form_state_' .
$form_state['values']['form_build_id'], 'cache_form');
drupal_static_reset('drupal_retrieve_form');

Thanks for any tips.

Simon

3/5/12

Re: [development] Remove Meta Tag Generator

I'm sure there was a good reason why it was added, and so there will be a closed issue in the queue somewhere. Find it, then reference it in your new feature issue to remove it. Such a discussion belongs in the core issue queues, not here on the mailing list.
 
Nancy
 
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.


From: webmaster

Hi Richard,
already exists and I'm using it: http://drupal.org/project/remove_generator
You got my point: I'd like to have something in the core without
having to install workarounds

Re: [development] Remove Meta Tag Generator

On Mon, Mar 5, 2012 at 5:03 AM, webmaster <fairsayan@gmail.com> wrote:
> Hi Richard,
> already exists and I'm using it: http://drupal.org/project/remove_generator
> You got my point: I'd like to have something in the core without
> having to install workarounds

It isn't a work around to install or write a module that adjusts the
defaults. It is the way it works. You can also use project/metatag
to insert per node meta tags and remove or modify the generator tag.
As Richard said, "why do you even care about this?" In other words,
why do you want to hide the fact that your content is being generated
by Drupal?

--
Earnie
-- https://sites.google.com/site/earnieboyd

Re: [development] Remove Meta Tag Generator

Hi Richard,
already exists and I'm using it: http://drupal.org/project/remove_generator
You got my point: I'd like to have something in the core without
having to install workarounds
Thanks,
Domenico

2012/3/5 Richard Burford <lists@freestylesystems.co.uk>:
> You could make a small module that does this with a settings form, a conf variable, and (as described in the link you posted) using hook_html_head_alter() to unset or otherwise alter the generator element.
>
> But, it begs the question - why do you even care about this?
>
> On 5 Mar 2012, at 09:49, webmaster wrote:
>
>> Hi,
>> I noticed that by default this tag is written:
>>  <meta name="Generator" content="Drupal 7 (http://drupal.org)" />
>>
>> I'm perplexed about that and I discover that someone else is sharing
>> my point of view: http://drupal.org/node/982034
>>
>> Do you think it would be possibile to add an option in the admin panel
>> to switch off this feature?
>>
>> Regards,
>> Domenico
>

[development] Remove Meta Tag Generator

Hi,
I noticed that by default this tag is written:
 <meta name="Generator" content="Drupal 7 (http://drupal.org)" />

I'm perplexed about that and I discover that someone else is sharing
my point of view: http://drupal.org/node/982034

Do you think it would be possibile to add an option in the admin panel
to switch off this feature?

Regards,
Domenico

3/1/12

[development] Invitation to connect on LinkedIn

LinkedIn

Fred Jones requested to add you as a connection on LinkedIn:

Anupom,

I'd like to add you to my professional network on LinkedIn.

- Fred

 
View invitation from Fred Jones

 

WHY MIGHT CONNECTING WITH FRED JONES BE A GOOD IDEA?

Fred Jones's connections could be useful to you

After accepting Fred Jones's invitation, check Fred Jones's connections to see who else you may know and who you might want an introduction to. Building these connections can create opportunities in the future.

 

© 2012, LinkedIn Corporation

Re: [development] Node reference in core?

On Thu, Mar 1, 2012 at 12:53 PM, Daniel F. Kudwien wrote:
> Am 01.03.2012 17:19, schrieb Karl Giesing:
>
>> Furthermore, we also need the ability to add Track nodes as we are
>> creating an Album node - that is, we need the ability to create multiple
>> nodes, and their references, all from the single form used to create an
>> album. What should NOT happen is that the user has to create each track
>> individually before they create an album that has those tracks - this is
>> a workflow nightmare. (And it's currently how Pushtape works.)
>>
>> There are currently three D7 modules used to create node references:
>> References, Entity Reference, and Relation. References is the only one
>> not currently in beta - and it's being depricated in favor of one of the
>> other two. Furthermore, as far as I can tell, none of the above allow
>> you to create the references unless the nodes already exist.
>
>
> Creating 0-n other entities as part of the initial creation/form flow of a
> parent entity, and handling that correctly in terms of what data to store
> where and what to do in case of validation errors down the line, is the
> tricky part.
>

How about taxonomy? You could have a term for the album and each
track node for the album adds the term.

--
Earnie
-- https://sites.google.com/site/earnieboyd

Re: [development] Node reference in core?

Am 01.03.2012 17:19, schrieb Karl Giesing:
> Furthermore, we also need the ability to add Track nodes as we are
> creating an Album node - that is, we need the ability to create multiple
> nodes, and their references, all from the single form used to create an
> album. What should NOT happen is that the user has to create each track
> individually before they create an album that has those tracks - this is
> a workflow nightmare. (And it's currently how Pushtape works.)
>
> There are currently three D7 modules used to create node references:
> References, Entity Reference, and Relation. References is the only one
> not currently in beta - and it's being depricated in favor of one of the
> other two. Furthermore, as far as I can tell, none of the above allow
> you to create the references unless the nodes already exist.

Creating 0-n other entities as part of the initial creation/form flow of
a parent entity, and handling that correctly in terms of what data to
store where and what to do in case of validation errors down the line,
is the tricky part.

That's a conceptual problem. Before even thinking of moving module X or
Y into core, we need to solve that conceptual problem.

AFAICS, there are two possible ways to approach it:

1) Form-stacking or multiple form-states

The parent entity creation form additionally needs to contain the
full creation forms for the referenced entities. As well as each
respective $form_state.

This requires a proper and clean encapsulation of form structures
and submitted form values. Because, you guessed it, all of the child
entity forms have the identical form structure (hence, same structure of
submitted form values), and it's even possible that the child form and
parent form happen to use the same names/structures.

Furthermore, the entire reference validation between the children
and the parent needs to work on hypothetical unsaved data, the submitted
form values. You cannot proceed to form submission (and start to save
entities) if there's a form validation error somewhere down the line.
Lastly, form submission would have to be processed "top-down", so as to
be able to inject the parent entity reference ID at the correct spots
for the child entities.

That said, we've prepared at least Field API in Drupal 7 for this
use-case in http://drupal.org/node/942310, primarily for these projects:
- http://drupal.org/project/combofield
- http://drupal.org/project/embeddable
- http://drupal.org/project/subform
- http://drupal.org/project/field_collection

chx created http://drupal.org/project/multiform as an attempt to
attack the Form API problem. I don't know how mature these projects are.

In any case, this approach is very complex and has a high potential
to be error-prone.


2) Auto-save

Instead of dealing with the complex problem at all, solve it in the
most pragmatic way: Create the parent entity early, very early; i.e.:

Save the parent entity when entering the parent entity creation
form. Thus, the parent entity exists, and so you can reference it from
within that very creation form.

Apparently, a couple of other CMSs, and even more so, offline and
mobile compatible web applications are doing that already. Disk space
is cheap and bogus/empty entities can be automatically pruned out later.
And of course, auto-save is a very nice usability feature on its own.

There's merely one giant show-stopper: form validation of required
fields (or entity CRUD-level validation of properties and field values).
Auto-save basically means that either no field can be required, or
that we'd save invalid data.

I don't want to pretend that this approach would be easier, but in
terms of total bang for the bucks, it would make much more sense to me.


Overall, we should have a serious discussion, BoF, if not even sprint on
this topic.

Thanks,
sun

Re: [development] Node reference in core?

I havent done alot of work in relations recently but from what ive
seen and used the relations module will probably be the way to go to
establish the relationship longer term but references gets thejob done
today for you. You might want to consider using a ctools multistep
form with an onscreen link on the "add album" edit page that links to
"add a track modal/multistep" and have it return the nid that is
created for relation to add it to the relation on the node youre
making in the last step.

I think this might be best handled as a custom multistep form that
takes the albums initial data repurposing the node edit form, track
data doing the same and then saves the entities in the correct order
but hopefully someone has a more concrete answer for you that has been
down your path. Good luck and please let us know how you settle it.

--
Michael Favia                   michael@favias.org
tel. 512.585.5650            http://www.favish.com

Re: [development] Node reference in core?

On Thu, Mar 1, 2012 at 11:19 AM, Karl Giesing <khzmusik@hotmail.com> wrote:
>
> His module is track-centered, whereas mine is album-centered. In order to
> have tracks and albums as separate nodes, we need to have some sort of
> reference to multiple track nodes from an album node.
>
> Furthermore, we also need the ability to add Track nodes as we are creating
> an Album node - that is, we need the ability to create multiple nodes, and
> their references, all from the single form used to create an album. What
> should NOT happen is that the user has to create each track individually
> before they create an album that has those tracks - this is a workflow
> nightmare. (And it's currently how Pushtape works.)
>

The first thing that came to my mind is
http://drupal.org/project/relativity but there is no D7 version as
yet. It would be a great start to having a parent node as the album
cover and the children of that node be the tracks.

--
Earnie
-- https://sites.google.com/site/earnieboyd

[development] Node reference in core?

Hello, all. This is Karl, aka Karlheinz, the developer for the Discogs module.

I'm trying to work with Zirafa, author of the Pushtape module, to come up with a centralized discography framework for Drupal. (I'm also going to see if the Spotify module wants to get on board with this.) We have, however, run into a snag.

His module is track-centered, whereas mine is album-centered. In order to have tracks and albums as separate nodes, we need to have some sort of reference to multiple track nodes from an album node.

Furthermore, we also need the ability to add Track nodes as we are creating an Album node - that is, we need the ability to create multiple nodes, and their references, all from the single form used to create an album. What should NOT happen is that the user has to create each track individually before they create an album that has those tracks - this is a workflow nightmare. (And it's currently how Pushtape works.)

There are currently three D7 modules used to create node references: References, Entity Reference, and Relation. References is the only one not currently in beta - and it's being depricated in favor of one of the other two. Furthermore, as far as I can tell, none of the above allow you to create the references unless the nodes already exist.

I had hoped that the new Fields API in D7 would have included this functionality, but alas it was not the case. (I was actually very surprised at this; frankly, I believe it should have been in Drupal since day 1. A "node" is just a piece of information, after all, and there's a reason everyone uses a "relational" database for information.)

So, I'm wondering if there isn't the possibility of moving this functionality into Drupal core. If not for D7 (which seems like a lost cause), then for D8 at the very least.

In the meantime, is there any one of the three aforementioned node reference modules that the folks at Drupal core think is most promising? We absolutely, positively need this functionality, and we don't want to have to change dependencies - again - due to issues with third parties.

p.s. I've been reading all the posts about re-purposing this list to include module developers. We've had this conversation before, but if it's being considered again, I am all for it. The support list is ABSOLUTELY NOT useful in any way for us, and there is currently NO appropriate mailing list for module developers to use.

In the meantime, I've been using the Module Development and Code Questions section of the forum, when I need to.

2/29/12

drupal.org mailing list memberships reminder

This is a reminder, sent out once a month, about your drupal.org
mailing list memberships. It includes your subscription info and how
to use it to change it or unsubscribe from a list.

You can visit the URLs to change your membership status or
configuration, including unsubscribing, setting digest-style delivery
or disabling delivery altogether (e.g., for a vacation), and so on.

In addition to the URL interfaces, you can also use email to make such
changes. For more info, send a message to the '-request' address of
the list (for example, mailman-request@drupal.org) containing just the
word 'help' in the message body, and an email message will be sent to
you with instructions.

If you have questions, problems, comments, etc, send them to
mailman-owner@drupal.org. Thanks!

Passwords for gruz_@bigmir.net:

List Password // URL
---- --------
development@drupal.org saibawix
http://lists.drupal.org/mailman/options/development/gruz_%40bigmir.net

documentation@drupal.org difiusur
http://lists.drupal.org/mailman/options/documentation/gruz_%40bigmir.net

Re: [development] Was, write a simple field type for CCK, now module development

OMG, we're all a bunch of pedantic buffoons! We've got a mailing list called "development@drupal.org". It gets one email a week. And someone asks a question about how to properly do drupal CCK development, and we send them to another mailing list whilst arguing about whether this list should be re-tasked?

Seems to me we're killing ourselves here, unneccessarily. Look, development is development. CCK is mostly in core anyway, so where does a questions like that belong? In the contrib-development mailing list or the core-development mailing list? ;)

Carry on, mate.
--
Joel Farris
Transparatech, Inc
"There are no mysteries here."
G+ Skype Twitter: joelfarris


>> From: John Summerfield
>>
>> Where, then, should those seeking help with module development turn? There's a themes list, but not one for modules.

Re: [development] Was, write a simple field type for CCK, now module

Agreed, as well. Given that most core discussion has moved elsewhere, I don't see the problem in repurposing this list for general module development (as opposed to support being general Drupal "how-do-I" questions).

Regards,
Todd

On 29 February 2012 09:45, Sam Tresler <sam@treslerdesigns.com> wrote:
I agree as well. There is a valid use case for a list that addresses development of modules and actual problems people encounter when developing new functionality that is separate from support. This would hopefully end the pattern, of late, of the list being dead until someone has a support question and someone else smacks it down.

Regards,
 Sam Tresler


On 02/29/2012 08:06 AM, Richard Burford wrote:
I agree that this list should be repurposed for technical development discussions.

Let's get out of the habit of scolding users for posting development questions to the development list.

Regards,

Richard

--
http://fs.io/
http://dgo.to/@psynaptic
http://twitter.com/psynaptic
http://drupalcontrib.org/


Re: [development] Was, write a simple field type for CCK, now module development

I do agree in this particular case that the question would be more appropriate for the support list. But I also think there should be a development list for programming questions that aren't specific to core. Most of the questions at this level go unanswered on the support list.

How many would need to agree to retasking the list before we would be able to ask webchick to make the change?

Cameron

On Feb 29, 2012, at 8:29 AM, "Ms. Nancy Wichmann" <nan_wich@bellsouth.net> wrote:

The Support list.



From: John Summerfield


Where, then, should those seeking help with module development turn? There's a themes list, but not one for modules.

Re: [development] Was, write a simple field type for CCK, now module

I agree as well. There is a valid use case for a list that addresses
development of modules and actual problems people encounter when
developing new functionality that is separate from support. This would
hopefully end the pattern, of late, of the list being dead until someone
has a support question and someone else smacks it down.

Regards,
Sam Tresler

On 02/29/2012 08:06 AM, Richard Burford wrote:
> I agree that this list should be repurposed for technical development discussions.
>
> Let's get out of the habit of scolding users for posting development questions to the development list.
>
> Regards,
>
> Richard
>
> --
> http://fs.io/
> http://dgo.to/@psynaptic
> http://twitter.com/psynaptic
> http://drupalcontrib.org/
>