Hello: this is my select multi form 'color' => array ( '#type' => 'select', '#title' => t('Color'), '#size' => '10', '#multiple' => 'TRUE', '#default_value' => $selected, '#options' => $select_colors, how can I insert the values in database ? how can I read values from databases ? Thanks.
On 04/30/2011 12:48 PM, Damian Adriel Perez Valdes wrote:
how can I insert the values in database ? how can I read values from databases ?
We use submission and validation hooks as well as form hooks to display them. http://api.drupal.org/api/drupal/includes--form.inc/group/form_api/7 If youre using this form to store configuration variables we take care of all of that mumbo jumbo for you with: http://api.drupal.org/api/drupal/modules--system--system.module/function/sys... Which really just tacks on its own submission function to automatically store the values for you (you retrieve them with variable_get() in default form values. Please see the 22 examples that use the form on that page. -- Michael Favia michael@favish.com tel. 512.669.5650 http://www.favish.com
Hi, Got views to work for my module but cannot figure how to use a field which is not in the base table. Using fields which are not in the base table cause the views editor to say "missing handler" next to the field. As an example I have the tables table NAME NAME_ID LAST_NAME FIRST_NAME and table ADDRESS NAME_ID ADDRESS_LINE_1 ADDRESS_LINE_2 I want to display both ADDRESS_LINE_1 and LAST_NAME. I have tried adding the following but get the missing handler error. $data['NAME']['LAST_NAME'] = array( 'title' => t('Last name'), 'help' => t('Last name.'), 'field' => array( 'handler' => 'views_handler_field_string', 'click sortable' => TRUE, ), 'filter' => array( 'handler' => 'views_handler_filter_string', ), 'sort' => array( 'handler' => 'views_handler_sort', ), 'argument' => array( 'handler' => 'views_handler_argument_string', ), );
Don't you need to define a "relationship" to explain the JOIN to Views? Nancy Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr. ________________________________ From: Iain Wiseman Got views to work for my module but cannot figure how to use a field which is not in the base table. Using fields which are not in the base table cause the views editor to say "missing handler" next to the field.
On 5/1/2011 4:56 AM, Iain william Wiseman wrote:
I will google this. I am very new. Never read docs but learn by example - bad I know.
In an open source community where you're leaning on volunteers for help, this is an incredibly disrespectful way to get started in the people who work in the community.
On 2/05/2011 2:23 a.m., Earl Miles wrote:
On 5/1/2011 4:56 AM, Iain william Wiseman wrote:
I will google this. I am very new. Never read docs but learn by example - bad I know. In an open source community where you're leaning on volunteers for help, this is an incredibly disrespectful way to get started in the people who work in the community. Thank you for your useful contibution and your openess to other ways of learning.
Calling that "another way of learning" is like calling panhandling "another way of earning a living". Neither benefits the community you belong to and both detract from the gainful contributions of others in time and resources. That said your question was a reasonable one for this list imo. Some folks even after reading api and docs ask much worse. Welcome to drupal. Respect others time and we'll respect yours. ;) -mf On May 1, 2011 3:36 PM, "Iain William Wiseman" <iwiseman@bibble.co.nz> wrote:
On 2/05/2011 2:23 a.m., Earl Miles wrote:
On 5/1/2011 4:56 AM, Iain william Wiseman wrote:
I will google this. I am very new. Never read docs but learn by example - bad I know. In an open source community where you're leaning on volunteers for help, this is an incredibly disrespectful way to get started in the people who work in the community. Thank you for your useful contibution and your openess to other ways of learning.
On 2/05/2011 8:53 a.m., Michael Favia wrote:
Calling that "another way of learning" is like calling panhandling "another way of earning a living".
Neither benefits the community you belong to and both detract from the gainful contributions of others in time and resources.
That said your question was a reasonable one for this list imo. Some folks even after reading api and docs ask much worse. Welcome to drupal. Respect others time and we'll respect yours. ;)
-mf
On May 1, 2011 3:36 PM, "Iain William Wiseman" <iwiseman@bibble.co.nz <mailto:iwiseman@bibble.co.nz>> wrote:
On 2/05/2011 2:23 a.m., Earl Miles wrote:
On 5/1/2011 4:56 AM, Iain william Wiseman wrote:
I will google this. I am very new. Never read docs but learn by example - bad I know. In an open source community where you're leaning on volunteers for help, this is an incredibly disrespectful way to get started in the people who work in the community. Thank you for your useful contibution and your openess to other ways of learning.
Thanks, Reading the docs makes little sense without real examples. Only when I understand how it works can I find relevance in the docs. I am not asking everyone to work this way but it is the way I work and I have found I make progress using this approach. Google is your friend. I am happy to share my knowledge without first asking if someone has read the manual back to back or for that matter even opened it. The aim, for me, is to get people to contribution and to make progress. I quick google of bibble_235 drupal will show I also contribute as well.
Name calling serves no one any good. Different people learn in different ways. I, too, am one who learns better by doing, so examples are beneficial, especially if they even remotely relate to my issue. And, yes, I even occasionally try to "do before reading" because a solution without a problem seems to be the tail wagging the dog. But when it comes time to read, I do so. Unfortunately, computers only do what you tell them to do, so searching requires the correct terms, and Views docs, in particular, are filled with terms that don't trip off the fingers of the uninitiated readily. That's no slight to Mr. Miles at all; he writes concisely. In my initial response, I gave Mr. Wiseman, the term "relationship" with which to search, hoping that it would get him to the docs he needed. Since I was just waking up and needed to get ready for church, I didn't have time to find the article for him. Mr. Wiseman, in case you didn't know, Mr. Miles is known as "Merlinofchaos" on Drupal.org; strike a bell? I think there might be one other bit of reading that you might want to do: the description of these lists. In contrast to what Mr. Favia wrote, it seems to me that this question should have been in the Support list as it does not deal with the development of Drupal itself. Nancy Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr. ________________________________ From: Iain William Wiseman Calling that "another way of learning" is like calling panhandling "another way of earning a living".
Neither benefits the community you belong to and both detract from the gainful contributions of others in time and resources.
That said your question was a reasonable one for this list imo. Some folks even after reading api and docs ask much worse. Welcome to drupal. Respect others time and we'll respect yours. ;) -mf On May 1, 2011 3:36 PM, "Iain William Wiseman" <iwiseman@bibble.co.nz> wrote:
On 2/05/2011 2:23 a.m., Earl Miles wrote:
On 5/1/2011 4:56 AM, Iain william Wiseman wrote:
I will google this. I am very new. Never read docs but learn by example - bad I know. In an open source community where you're leaning on volunteers for help, this is an incredibly disrespectful way to get started in the people who work in the community. Thank you for your useful contibution and your openess to other ways of learning.
Thanks, Reading the docs makes little sense without real examples. Only when I understand how it works can I find relevance in the docs. I am not asking everyone to work this way but it is the way I work and I have found I make progress using this approach. Google is your friend. I am happy to share my knowledge without first asking if someone has read the manual back to back or for that matter even opened it. The aim, for me, is to get people to contribution and to make progress. I quick google of bibble_235 drupal will show I also contribute as well. On 2/05/2011 8:53 a.m., Michael Favia wrote:
On 2/05/2011 12:26 p.m., Ms. Nancy Wichmann wrote:
Name calling serves no one any good. Different people learn in different ways. I, too, am one who learns better by doing, so examples are beneficial, especially if they even remotely relate to my issue. And, yes, I even occasionally try to "do before reading" because a solution without a problem seems to be the tail wagging the dog. But when it comes time to read, I do so. Unfortunately, computers only do what you tell them to do, so searching requires the correct terms, and Views docs, in particular, are filled with terms that don't trip off the fingers of the uninitiated readily. That's no slight to Mr. Miles at all; he writes concisely. In my initial response, I gave Mr. Wiseman, the term "relationship" with which to search, hoping that it would get him to the docs he needed. Since I was just waking up and needed to get ready for church, I didn't have time to find the article for him. Mr. Wiseman, in case you didn't know, Mr. Miles is known as "Merlinofchaos" on Drupal.org; strike a bell? I think there might be one other bit of reading that you might want to do: the description of these lists. In contrast to what Mr. Favia wrote, it seems to me that this question should have been in the Support list as it does not deal with the development of Drupal itself.
/*Nancy*/
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
Thank Nancy, So development of drupal modules which are not part of the core go to support - I did not know this so thanks. Will be looking a views again tonight (day job to do!). I am looking into helping out port LinkedIn to Drupal 7 but felt I might be best just getting a simple view/database module going first. I do have on question with regard to building the code though, is there a standard approach to where to put the bits. I understand .install and .info but where how to split up the pages seems unclear to me. Iain
On 6:59 AM, Iain William Wiseman wrote:
On 2/05/2011 12:26 p.m., Ms. Nancy Wichmann wrote:
Name calling serves no one any good. Different people learn in different ways. I, too, am one who learns better by doing, so examples are beneficial, especially if they even remotely relate to my issue. And, yes, I even occasionally try to "do before reading" because a solution without a problem seems to be the tail wagging the dog. But when it comes time to read, I do so. Unfortunately, computers only do what you tell them to do, so searching requires the correct terms, and Views docs, in particular, are filled with terms that don't trip off the fingers of the uninitiated readily. That's no slight to Mr. Miles at all; he writes concisely. In my initial response, I gave Mr. Wiseman, the term "relationship" with which to search, hoping that it would get him to the docs he needed. Since I was just waking up and needed to get ready for church, I didn't have time to find the article for him. Mr. Wiseman, in case you didn't know, Mr. Miles is known as "Merlinofchaos" on Drupal.org; strike a bell? I think there might be one other bit of reading that you might want to do: the description of these lists. In contrast to what Mr. Favia wrote, it seems to me that this question should have been in the Support list as it does not deal with the development of Drupal itself.
/*Nancy*/
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
Thank Nancy,
So development of drupal modules which are not part of the core go to support - I did not know this so thanks.
Will be looking a views again tonight (day job to do!). I am looking into helping out port LinkedIn to Drupal 7 but felt I might be best just getting a simple view/database module going first. I do have on question with regard to building the code though, is there a standard approach to where to put the bits. I understand .install and .info but where how to split up the pages seems unclear to me.
Iain
Iain, It's not the clearest distinction at times with regard to the mailing lists, I fell for it too. The distinction I work with is development is for development *of* Drupal, and support covers development *with* Drupal (as well as a plethora of other things). As far as docs go, there are degrees. Examples are part of the documentation and the part that I, personally, would go to first. I wouldn't tell anyone to read an API document from top to bottom, it's something you delve into when you've exhausted all the high level stuff or if you need a level of detail not covered by generic examples. Malks.
In general, I don't split the module up until it gets to some point in size, which is just a judgment call. Then the first thing I look at is splitting the admin functions out to mymodule.admin.inc. If it keeps getting bigger, I look at what the functions are and which ones they use. If a function is not used commonly, I will split it off. I suspect my call on that is from the early days of my career when commercial virtual memory was in its early days too and we worried about "locality of reference." I know PHP is different to some extent, but I like to keep calling and called code near each other to reduce page faults. That's also why I try to keep "one time" (actually only infreqent) calls, such as hook_menu(), separated from the more active code in my modules. NancyDru Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr. ________________________________ From: Iain William Wiseman Will be looking a views again tonight (day job to do!). I am looking into helping out port LinkedIn to Drupal 7 but felt I might be best just getting a simple view/database module going first. I do have on question with regard to building the code though, is there a standard approach to where to put the bits. I understand .install and .info but where how to split up the pages seems unclear to me.
On 02/05/11 12:54, Ms. Nancy Wichmann wrote:
In general, I don't split the module up until it gets to some point in size, which is just a judgment call. Then the first thing I look at is splitting the admin functions out to mymodule.admin.inc. If it keeps getting bigger, I look at what the functions are and which ones they use. If a function is not used commonly, I will split it off. I suspect my call on that is from the early days of my career when commercial virtual memory was in its early days too and we worried about "locality of reference." I know PHP is different to some extent, but I like to keep calling and called code near each other to reduce page faults. That's also why I try to keep "one time" (actually only infreqent) calls, such as hook_menu(), separated from the more active code in my modules.
/*NancyDru*/
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
------------------------------------------------------------------------ *From:* Iain William Wiseman
Will be looking a views again tonight (day job to do!). I am looking into helping out port LinkedIn to Drupal 7 but felt I might be best just getting a simple view/database module going first. I do have on question with regard to building the code though, is there a standard approach to where to put the bits. I understand .install and .info but where how to split up the pages seems unclear to me.
Thanks all who provided help. For reference, my issue was caused by not uninstalling and re-installing the module. Once this was done all worked fine. Next, multi-step form.
On 5/1/2011 1:36 PM, Iain William Wiseman wrote:
On 2/05/2011 2:23 a.m., Earl Miles wrote:
On 5/1/2011 4:56 AM, Iain william Wiseman wrote:
I will google this. I am very new. Never read docs but learn by example - bad I know. In an open source community where you're leaning on volunteers for help, this is an incredibly disrespectful way to get started in the people who work in the community. Thank you for your useful contibution and your openess to other ways of learning.
You clearly misunderstand my remarks. There are people who are happy to be helpful, and ignoring the argument of whether or not this question was appropriate here or not, a question that is posed before one even looks at the documentation is disrespectful to the people who you expect to put time into your answer. Questions like "I read the docs but I don't understand," are going to be met with much more openness than "I don't read docs, just give me the answer." We work very hard at what we do, all of us. Perhaps you have "other ways of learning" but "I don't read docs" is the same as saying "Screw you, just tell me how to do it." Someone put a whole lot of time into those docs in hopes of avoiding having to ask questions. And if you'd rather have examples, a LOT of modules out there integrate with Views. There are lots of examples. It is incumbent upon you to seek them out.
There are people who are happy to be helpful, and ignoring the argument of whether or not this question was appropriate here or not, a question that is posed before one even looks at the documentation is disrespectful to the people who you expect to put time into your answer.
Questions like "I read the docs but I don't understand," are going to be met with much more openness than "I don't read docs, just give me the answer."
We work very hard at what we do, all of us. Perhaps you have "other ways of learning" but "I don't read docs" is the same as saying "Screw you, just tell me how to do it." Someone put a whole lot of time into those docs in hopes of avoiding having to ask questions.
He finally got to google by itself, without this morale lesson. I agree with you on this Earls, but you are being tough here. Pierre.
participants (9)
-
Anth -
Damian Adriel Perez Valdes -
Earl Miles -
Iain william Wiseman -
Iain William Wiseman -
Iain Wiseman -
Michael Favia -
Ms. Nancy Wichmann -
Pierre Rineau