7,blocksRelated issues-Collection of common programming errors


  • kiamlaluno
    7 forms
    I have a form with radios on it. I do submit on the same page (there’s no $form[‘#action’] assigned in the below code). What I want to do is to get submitted year in template.php so that I can define my logic based on received value.To check that’s all work fine I wanted print_r the contents of form[‘values’]. I did that in submit function but it didn’t work. Actually, I can’t print anything from both validate and submit functions.So my question is how I can get the submitted value to template.p

  • everaftergraphics
    7 taxonomy css
    I have to create a website that allows for a “new” tag to be floated above certain pictures that have the specific taxonomy term of “new”. I created a view for the “new” where I added an empty div below the image and then floated it above the image and added the actual “new” image with CSS. This is what it looks like For the “new” node.tpl.php the code looks like this:<article class=”node-<?php print $node->nid; ?> <?php print $classes; ?> clearfix”<?php print $attributes

  • Waqas
    7 hook-form-alter
    I am implementing hook_form_FORM_ID_alter(). I have managed to setup for, and be able to collect custom values from the fields. When I submit the form, the node is created without my custom fields (i.e field_1 an field_2).function mymodule_form_AYG_node_form_alter(&$form, &$form_state, $form_id){$options_first = _mymodule_get_first_dropdown_options();$selected = isset($form_state[‘values’][‘field_1’]) ? $form_state[‘values’][‘field_1’] : key($options_first);$form[‘field_1’] = array(‘#wei

  • ijujym
    7 drush
    Iv managed to install Drush to the site on Go Daddy shared hosting(thanks to the greate tutorial!). Simple commands run without any errors, but when I try:drush pm-update ctoolsIt returns:-bash-3.2$ drush pm-update ctools The external command could not be executed due to an application error. [error][error]<br /> <b>Parse error</b>: syntax error, unexpected ‘{‘ in <b>/home/

  • kiamlaluno
    7 taxonomy ubercart
    I upgraded a D6/Ubercart 2 website to D7/Ubercart 3. The upgrade seems to have gone very well and I have all of my updated modules installed. The only issue I am seeing right now is that I cannot save changes to any Ubercart Product content node. When I try to edit and save a product node, I receive a generic “The website encountered an unexpected error. Please try again later” error. However, watchdog is more verbose with what went wrong:PDOException: SQLSTATE[42000]: Syntax error or access vio

  • Webdrips
    7 panels
    I’ve recently taken over a site that’s displaying a very generic error when attempting to access a page that’s known not to exist (e.g. /people/incorrect-name): “The website encountered an unexpected error. Please try again later.” I checked the log and I see this: Recoverable fatal error: Argument 2 passed to drupal_goto() must be an array, string given in drupal_goto() (line 686 of common.inc).I then started looking at how the /people/* pages are built. It turns out two panel pages are in play

  • Rosamunda Rosamunda
    7 fields panels tokens display-suite
    I have this core profile field in Drupal7: profile-curso-basico. I want it to be shown in the user´s profile only if the field has information in it (it´s a deprecated field, but some old users have data in it, and migrate modules didn´t import it properly, because it´s a hardcoded list).I´m using panels, token and Display Suite modules. At the profile page, I have this panel with a special coded DS field, that has dinamic information using tokens.If I just paste: Mi Curso: %user:profile-curso

  • Lukasz Zaroda
    7 drush
    I’m trying to upload a database on the server with SSH by using sql-sync, but I’m getting the following error:PHP Parse error: syntax error, unexpected ‘{‘ in /home/luken/programs/drush/includes/environment.inc on line 517 X-Powered-By: PHP/4.4.7 Content-type: text/html […]As you see from the error message, it is using PHP 4.4.7, while I want to use PHP 5.4.I tried adding the following line to .bash_profile.export DRUSH_PHP=php54 (that is php version I wanted to use, and it works when I normal

  • Alp
    7 ubercart payment
    I am using Drupal 7.12 and Ubercart 3.0. I created a custom module in order to enable a single page checkout by skipping the checkout review page.The Code/*** Implementation of hook_form_submit().* * Change Ubercart review pages to instant order submissions.*/ function uc_onepagecheckout_form_submit($form, &$form_state) {// check for order submitif(isset($form_state[‘storage’][‘order’])) {$order_id = $form_state[‘storage’][‘order’]->order_id;$reviewRequested = $_SESSION[‘uc_checkout’][$or

  • SomethingOn
    7 feeds
    Using the W3C Feed validator my very basic RSS feed from a View fails validation. It seems to be all of the additional attributes in the element:<?xml version=”1.0″ encoding=”utf-8″ ?><rss version=”2.0″ xml:base=”http://mydomain.com/blog” xmlns:dc=”http://purl.org/dc/elements/1.1/” content=”http://purl.org/rss/1.0/modules/content/” dc=”http://purl.org/dc/terms/” foaf=”http://xmlns.com/foaf/0.1/” og=”http://ogp.me/ns#” rdfs=”http://www.w3.org/2000/01/rdf-schema#” sioc=”http://rdfs.org/s

  • Mudasir Abi
    views blocks
    I have SQL Query and I want to execute it in Drupal. My SQL Query is like this. select cat.tid as cat_tid, cat.name as cat_name, cat_parent.parent as cat_parent_tid, count(deals.nid) as no_of_deals from taxonomy_term_data as catleft outer join taxonomy_term_hierarchy as cat_parent on cat_parent.tid=cat.tidleft outer join field_revision_field_categories as store_categories on store_categories.field_categories_tid=cat.tidleft outer join field_revision_field_store as deal_stores on field_store_n

  • Mark Daly
    7 blocks links
    In one of our Drupal sites (core 7.14) links in two blocks displayed on the front page recently started using one of the alternate domains defined in the Apache config for the site instead of the primary domain. Neither block was changed recently. There are other blocks on the front page, and throughout the site, that were not affected.The links in the block were of the style href=”node/123″ (without a leading slash). After investigating any modules or settings that seemed related to blocks or l

  • John
    7 nodes taxonomy blocks
    I’m in drupal 7. Let’s say I have a block on a website page. The website page is a node that has taxonomy terms. How do I programatically get the taxonomy terms of the website page node from my block?

  • Tallkotten
    c++ sdl codeblocks blocks
    l SDL_BlitSurface(tileSheets.at(sheet), &clip[tile], screen, &tileBox);Works just fine and i initiliaze the clips like this:clip[ 0 ].x = x; clip[ 0 ].y = y; clip[ 0 ].w = 48; clip[ 0 ].h = 48; x += 48; clip[ 1 ].x = x; clip[ 1 ].y = y; clip[ 1 ].w = 48; clip[ 1 ].h = 48;This however doesnt work at allSDL_BlitSurface(tileSheets.at(sheet), &clip.at(tile), screen, &tileBox);I initilize them like this: for(int i = 0; i < number; i++){SDL_Rect clipBox = {x,y,48,48};clip.push_ba

  • George
    7 blocks
    I have a block module that displays some data taken from XML. That module has multiple (approx. 7) blocks, each of which displays a different “view” of the same XML. Each block can be positioned independently on the page, but all of the blocks are displayed at once and all of the blocks use the same data.Since the XML parsing code runs inside the block_view() hook, it runs once for every block.My problem is that the XML parsing is expensive in terms of time (not hugely so, but easily >95% of th

  • emenegro
    ios automatic-ref-counting blocks
    I’m wrapping an UIAlertView inside a regular NSObject to allow completion handler blocks instead of the delegate pattern.The problem is that I allocate a local instance of my object, that internally creates an UIAlertView and assigns its delegate to the object itself. When the alert is shown and the user taps a button, the apps crashes with an EXC_BAD_ACCESS because ARC has released my object and the delegate of the alert is that object.How could I handle this situation? I saw that a solution is

  • elpsk
    objective-c animation blocks
    I have several animation blocks, all of which follow this basic format with different delays so that they fire one after another:[UIView animateWithDuration:.85 delay:3 options:opts animations:[animations objectAtIndex:ww] completion:[completions objectAtIndex:ww]];The options are just UIViewAnimationOptionAutoreverse in a variable for easy access.I want there to be a delay between the animations and completion so that the images stay in their new position for a little bit before returning to th

  • justin k.
    objective-c cocoa objective-c-blocks blocks nsundomanager
    Of all the things that I would expect to support blocks, NSUndoManager curiously does not seem to do so. Is there some inherent reason for this, or has Apple simply not gotten around to modernizing this bit of API?In particular I would like to define a method on NSObject,- (void)performBlock {void (^block)(void) = (id)self;block(); }in order to be able to call,[[undoManager prepareWithInvocationTarget:^{NSLog( @”hello world” ); }] performBlock];Have I missed something? Is there anything wrong wi

  • Monolo
    objective-c cocoa cocoa-touch blocks objective-c-blocks
    Is calling a method on super supported in the implementation of an Objective-C block?When I was calling a method on super an EXC_BAD_ACCESS error would be thrown but as soon as I changed those calls from [super methodToCall] to [self methodToCall] and let the message move up the responder chain it worked fine. There is no implementation of -methodToCall in the instance of the class that the block exists in, but there is one in the superclass (that is, the class that self inherits from).I’m just

  • Brad Larson
    objective-c cocoa automatic-ref-counting blocks
    I have created a wrapper for the FBConnect iOS SDK that declares a block property for performing some code after successful login. Relevant code is as follows:typedef void(^FacebookServiceLoginBlock)(BOOL loginSuccessful);@interface FacebookService : NSObject <FBSessionDelegate,FBRequestDelegate> @property (nonatomic, copy) FacebookServiceLoginBlock loginBlock; – (void) checkAuthorization:(FacebookServiceLoginBlock)loginBlock; @end@implementation FacebookService @synthesize loginBlock;- (v

Web site is in building