7,i18n,debuggingRelated issues-Collection of common programming errors
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
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
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/
drone.ah
7 entities entity-api
We seem to be experiencing a very unexpected problem.We have created a custom entity called feature and it has a uid property. The schema is as follows:$schema[‘feature’] = array(‘fields’ => array(‘fid’ => array(‘description’ => ‘feature id’,’type’ => ‘serial’,’not null’ => TRUE,),’bundle’ => array(‘description’ => ‘bundle name’,’type’ => ‘varchar’,’length’ => 32,’not null’ => TRUE,),’nid’ => array(‘description’ => ‘Node ID.’,’type’ => ‘int’,’not null’ =>
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
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
Molot
7 6 migration mysql backup-and-migrate
I had a Drupal 6 site on a server that I’ve made a local copy of using Backup & Migrate. I’ve now upgraded this site to Drupal 7 on my localhost. When I try to move this to a server (or, as I’ve discovered, a new installation of D7 on localhost) I get the following errors once I run update.phpError messageNotice: date_default_timezone_set() [function.date-default-timezone-set]: Timezone ID ‘0’ is invalid in drupal_session_initialize() (line 273 of /Users/username/Sites/sitename/includes/sess
blue928
7 performance node-save
I am having a lot of trouble with the inefficiency of node_save(). But is node save my problem? That’s ultimately what I am trying to find out.I created a loop with 100,000 iterations. I created the bare minimum for the node object to be valid and save correctly. Here is the node save code:$node = new stdClass();$node->type = “test_page”;node_object_prepare($node);$node->uid = 1;$node->title = $node_title;$node->status = 1;$node->language = LANGUAGE_NONE;if($node = node_submit($n
gabriel_agm
linux ubuntu locale i18n
I’m usung Ubuntu 12.04 and after an automatic update it changed the system default encoding form UTF-8 to “ANSI_X3.4-1968”. I realized that when my code comments in Eclipse appeared with strange characters, and after realizing that the IDE was innocent, I’ve opened a terminal to check. When I type latin characters in a terminal window, such as çãõéèê…, a question mark shows instead. Same is I ‘cat’ a text file. Changing Ubuntu locale settings by GUI crashes the accounts-daemon:ExecutablePath:
Gisle Hannemyr
views modules i18n
Fatal error: Call to undefined function i18n_menu_translated_tree() inC:\xampp\htdocs\drupal\sites\all\themes\business\templates\page–front.tpl.phpon line 87my code is<nav id=”navigation” class=”clearfix” role=”navigation”><div id=”main-menu”><?php if (module_exists(‘i18n’)) {$main_menu_tree = i18n_menu_translated_tree(variable_get(‘menu_main_links_source’, ‘main-menu’));} else {$main_menu_tree = menu_tree(variable_get(‘menu_main_links_source’, ‘main-menu’));}print drupal_render(
Molot
views entity-reference i18n translation
I know I can simply add language to displayed title of a node in Entity Reference field based on views. What I failed to discover is how to limit possible values to only show and allow matching ones.When current node is language independent, all nodes should be listed as possible in reference field. When node has language defined, only nodes of the same language, or undefined language, should be available.I don’t really mind wrong selection to be saved in database if language of node will be cha
Artur
menu i18n error-messages
Has anyone run into trouble following i18n update to version 1.4? My site crashes badly with multiple notices about use of undefined constant MENU_PREFERRED_LINK. This is caused by Menu translation submodule.Submitted a bug report but thought maybe someone found out a cure for that.
Morpheu5
7 fields i18n entity-reference entity-field-queries
I’m using Drupal 7.14 and Entity API and Reference 1.0-rc3. I get this error when saving a node that has some custom fields using references.PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column’field_data_body0.nid’ in ‘on clause’: SELECTfield_data_body0.entity_type AS entity_type,field_data_body0.entity_id AS entity_id, field_data_body0.revision_idAS revision_id, field_data_body0.bundle AS bundle FROM{field_data_body} field_data_body0 INNER JOIN {node} node ONfield_data_body0.ni
kiamlaluno
7 i18n debugging
I have a multilingual client that “suddenly and randomly” started suffering errors and a site crash.The client assured us they “have not touched the site since it went live.” And, more or less we can confirm that given that we have not updated the site on their behalf, as we are the the only ones with update privilages. Has anyone had their multilingual site “just randomly crash” after months of being live with no problem?This is the error message. Has anyone seen this before?WD php: PDOExcepti
stacker
java debugging stack-trace local-variables
When getting a stacktrace as error report from an application that is already deployed, it would be helpful to also get the actual variable values to reconstruct the system’s state at the point before the exception was thrown.Is anything like that feasible in Java and how could one do that?Cheers, Max
Clinton
debugging project-management user customer-support
During beta testing, sometimes our end-users unfortunately encounter a bug. This inevitably leads to a bug report, where the Joel on Software article Painless Bug Tracking suggests:Every good bug report needs exactlythree things.Steps to reproduce,What you expected to see, andWhat you saw instead.This is usually pretty easy to enforce internally, however end-users often only send an email of what they saw (it crashed! Or it generated the wrong result!). They don’t always report what they expecte
periback2
java eclipse debugging svn mercurial
I’m running a java project in Eclipse, and using Subversion.When I open Eclipse, I’m getting this message about some unexpected Mercurial errors:There are some unexpected Mercurial errors occured. Please check the Error Log view for detailed information.. Command line: hg -y debuginstall. Command line: hg -y debuginstall. Command line: hg -y debuginstallSince I’m not using mercurial, do you have any idea why I’m getting this message?
Dirk Boer
entity-framework debugging entity-framework-5
Is it possible to set a breakpoint on every database call that’s being made by the Entity Framework? This would be a very simple way to debug where unexpected database calls are coming from.
Akash Patel
c++ debugging execution
While executing program i find some unexpected values(not garbage values)…so I need a way to examine variables value at every line of execution.please give a detail description of how do same.
Prakash
c++ debugging internet-explorer windows-vista
As part of a JavaScript Profiler for IE 6/7 I needed to load a custom debugger that I created into IE. I got this working fine on XP, but couldn’t get it working on Vista (full story here: http://damianblog.com/2008/09/09/tracejs-v2-rip/).The call to GetProviderProcessData is failing on Vista. Anyone have any suggestions?Thanks,Damian// Create the MsProgramProvider IDebugProgramProvider2* pIDebugProgramProvider2 = 0; HRESULT st = CoCreateInstance(CLSID_MsProgramProvider, 0, CLSCTX_ALL, IID_IDe
gary
c++ debugging compiler
So I just spent the last few hours pouring over code trying to figure out the source of a bug only to find that my error was none other than the obviously wrong but compiler accepted:if (a = b)where it should have been if (a == b)What do you guys do to safeguard against these frustrating errors? What other common “obviously wrong, but compiler won’t complain” bugs should I also watch out for?
Angel de Vicente
debugging intel
I’m a regular user of the Intel Debugger (right now version 13.0 in Ubuntu 12.10). I normally load the executable to debug and its arguments from the GUI itself, but I am trying to find a way to pass that information to the debugger from the command line. Maybe I’m overlooking something, but I don’t see the way to do it at the manual.The shell script that actually launches the GUI calls: java -jar $INSTALLDIR/debugger/gui/intel64/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar -showspla
Steven
php debugging
Below is the code of viewhistory.php.<?phpforeach($_POST as $value){if (empty($value)){ echo 1;exit();}}//come code;//SQL query;while($row=mysql_fetch_assoc($result)){//some code;if (!empty($reference)){$referencetxt=<<<html| Referenced Solution ID:$referencehtml;}else {$referencetxt=” “; }$item+=<<<htm<hr><span>Solution ID:$productid $referencetxt</span><xmp>$text</xmp><img src=$imagepath /><div align=”right”>$username $moment<
Jay Bazuzi
debugging
I want to know if there are method to quickly find bugs in the program.It seems that the more you master the architecture of your software, the more quickly you can locate the bugs.How the programmers improve their ability to find a bug?
Web site is in building
I discovery a place to host code、demo、 blog and websites.
Site access is fast but not money