I'm trying to validate that an uploaded file really does have the .csv extension. This code isn't working, however:
function upload_validate($form, &$form_state) {
// code that does work ...
else {
$file = file_save_upload('upload');
$errors = file_validate_extensions($file, 'csv');
if (! empty($errors)) {
form_set_err...
How do I use the form API to make a field that only accepts names of registered users? I know how to do the autocomplete to suggest user names already.
Specifically, I'm looking to replicate the field in the normal node creation process that allows the user to specify an author.
...
Hope this is the right place to ask this question. I am new to the forum (and to Drupal!).
I am developing a site using Drupal. Am using Zenophile Midnight and have created a Zen sub Theme. This has three columns, each with a black background.
I am trying to edit a View but when I open the views/edit node I find when I try to create a F...
I know how to successfully use arguments in drupal's views module, but when it "filters" based on those arguments it uses "=" in the where clause of the SQL statement. However, I would like to use "like" instead of "=" in the where clause of the SQL statement so I can pass in, say the title of a node, as an argument and then show all nod...
I have a bunch of Bout nodes. Each Bout is associated with a school, and a player who goes to that school. I am thinking it will work to do this association through taxonomy. (The schools and players are drawn from a list that remains fairly constant over time.)
One idea is to have the school name be the parent term, with players as chi...
I want to wrap a word in <strong> tags. Is it correct to do that right in the t() call, or am I supposed to do it some other way?
$help = '<p>' . t("Does this sample data look right for node type %node_type? If not, use your browser's <strong>back</strong> button to fix it on the previous page.", array('%node_type' => $_SESSION[NODE_TYP...
I'm trying to validate a set of nodes before saving them to the database:
foreach ($nodes_to_save as $node) {
if (! (node_validate($node, $form))) {
form_set_error('', t('Node %title did not validate. No nodes were saved.', array('%title' => $node->title)));
$success = FALSE;
break;
}
}
The documentatio...
I have constructed a set of nodes. After running them through node_save(), I get back an nid, and I can navigate to the page for that node, but they are empty. (No data is shown for any of the fields.)
When I go to the edit url for that node, I get this error message:
warning: call_user_func_array()
[function.call-user-func-array]...
I'm using the decisions module for drupal and it currently has no views integration. I'm looking for a way to use some simple filters based on this module in views. How do you integrated a module with views? All of the available documentation is extremely vague.
...
Hello folks.
I'm trying to give one of my roles the administrative rights to add/remove content in a specific menu (but not all menus). I think I found a module that should enable something like this, http://drupalmodules.com/module/delegate-menu-administration
I've followed the instructions, added the role to my user, checked the "adm...
I haven't worked to much within the template.php file in the Drupal installation, but this time I need to theme a node form. Following an excellent guide I found at http://drupal.org/node/601646, I set up the following snippet.
function amity_island_theme($existing, $type, $theme, $path) {
if ((arg(0) == 'node') && (arg(1) == 'add') &...
I have been wracking my brain on how to solve this issue for hours now, and I know I'm not the first one to encounter it.
I am having trouble granting anonymous users access to node content in Drupal 6.15. I have tried everything, including inserts to MySQL, checking and double-checking every permissions setting available (yes, I have e...
I'm working on a module and am trying to add some javascript to the next page a user sees after logging in or out. Calling drupal_add_js() on hook_user (op == login) doesn't seem to work; I'm assuming this is because drupal_goto is called after the login is completed and a fresh page request is initiated.
I've considered using hook_use...
I have Apache Solr 6.x-1.0-rc3 module installed in my site and it works fine. I wanted to know how are the Apache Solr search results sequenced. I have tried a few things and have concluded that it's not alphabetical or according to the recently updated node.
How are the search results sequenced? I mean in what order or logic.
...
First time user here:
I am wondering how you can change the directory of blog posts from www.yoursite.com/node/... to www.yoursite.com/blog/...?
...
hi!
i've a node type "Gallery" and a menu title "Gallery" which shows all the available galleries with the help of views.
Now, when the user creates a new gallery, i want the name(title) of that gallery to add as a child element to the "Gallery" menu item..
is there any module for that?
thankx..
...
I am working with a hook_form_alter on a CCK type (for you drupal-ers). I have a field that is normally a select list in my node form. However, in this instance, I want to hide the select list, and populate its value in the form with an SQL query.
Everything was going nicely. I could see that my desired value was showing up in the HTML...
I recently migrated a drupal website to a new domain name. The site works fine with one problem . Each time I try to save any data on any of the admin pages , I end up getting redirected to the old url. I have tried a lot to search and find an answer to this problem .. but to no avail. Kindly help .
THanks
...
hi!
the default login form in drupal doesn't have any javascript to check whether the fields(Username and password) are empty or not before submitting the form.
so, i want to add it onsubmit to the user login form..how can i do that?
...
I am working on an issue i'm having with hooking a field, setting the default value, and making it hidden. The problem is that it is taking the default value, but only submitting the first character of the value to the database.
//Here is how I'm doing it
$form['field_sr_account'] = array( '#type' => 'hidden', '#value' => '45');
I sup...