views,modules,i18nRelated issues-Collection of common programming errors
craig
views helpers ruby-on-rails-3
I would like move the following from my View into the model’s associated helper:<%= link_to_unless params[:aged]==’0′, “0”, jobs_path(:aged => ‘0’, :sort=>params[:sort],:dir=>params[:dir],:fav=>params[:fav]) %> | <%= link_to_unless params[:aged]==’30’, “30”, jobs_path(:aged => ’30’, :sort=>params[:sort],:dir=>params[:dir],:fav=>params[:fav]) %> | <%= link_to_unless params[:aged]==’60’, “60”, jobs_path(:aged => ’60’, :sort=>params[:sort],:dir=>param
Peter Mortensen
sql sql-server sql-server-2005 tsql views
Apology for a lengthy post, but I needed to post some code to illustrate the problem.Inspired by the question *What is the reason not to use select ?, I decided to point out some observations of the select * behaviour that I noticed some time ago.So let’s the code speak for itself:IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[starTest]’) AND type in (N’U’)) DROP TABLE [dbo].[starTest] CREATE TABLE [dbo].[starTest]([id] [int] IDENTITY(1,1) NOT NULL,[A] [varchar](50) N
Layla
ruby-on-rails twitter-bootstrap views partial-views
I am using twitter Boostraps tabbable feature found here: http://twitter.github.com/bootstrap/components.html#navsAnd within this navigation content window, I am trying to render a view that displays a “course”. This view found in views/courses/_show.html.erb looks like this:<div class=”center hero-unit”> <h1><%= @course.course_name %></h1><%= link_to ‘New Question Set’,new_answer_path(:course_ID => @course.id), :class => “btn btn-large btn-primary” %> <%=
allanb
drupal views
Below is some Views data that I would like to use. How would I render just the ‘Lorem ipsum’? ThanksstdClass Object ([nid] => 13337[node_data_field_marquee_image_field_marquee_image_fid] => 7778[node_data_field_marquee_image_field_marquee_image_list] => 1[node_data_field_marquee_image_field_marquee_image_data] => a:3:{s:11:”description”;s:11:”Lorem ipsum”;s:3:”alt”;s:0:””;s:5:”title”;s:0:””;}[node_language] => [node_type] => article[node_vid] => 2
Akki
drupal-6 views
The “Trim this field to a maximum length” option is giving me some pretty unexpected and confusing results. I have decided I want my field length to be cut off after 35 characters. However when I specify this amount in the “Maximum Length” text box and save the view, the field is completely cut off, everything is gone.So as a test I raised the limit to 100 characters, this gave me some of the field. However I don’t know where Views is getting the 100 characters from? What does it consider a char
beck03076
ruby-on-rails views quotes double-quotes
<%= render ‘shared/modal’,id: ‘assignToModal’, button: ‘<button onclick=”groupAssignTo(‘<%= _id %>’);”>Assign</button>’ %>Consider the above code in a rails app view file(.html.erb). It will throw a,ActionView::Template::Error (/home/think/../app/views/junks/_abc.html.erb:39: syntax error, unexpected tIDENTIFIER, expecting keyword_endIts because in the button local of the render statement, the single quote starts before < and does not end after >, instead ends before
OMG Ponies
sql postgresql views phppgadmin updatable-views
I am attempting to create a View in PhpPgAdmin (PostGreSQL db) which has the following SQL statement:DELETE FROM myTable WHERE myTable.error IS NULL;PhpPgAdmin gives me the following error:ERROR: syntax error at or near “DELETE” at character 59In statement:CREATE OR REPLACE VIEW “Schema1″.”Delete empty errors” AS DELETE FROM myTable WHERE myTable.error IS NULL;As far as I can tell this SQL statement is valid, and I have delete privileges for the table. Is the DELETE statement not allowed in Vi
Thomas Schultz
python django views
I have a django view that looks like…def add_user(request):if User.objects.get(username__exact = request.POST[‘username’]):context = { ‘message’: “Username already taken”}return render_to_response(“mytemplate.html”, context, RequestContext(request))newUser = User(username=”freeandclearusername”)newUser.save()#then other code that is related to setting up a new user.The other code that is related to setting up the user is still ran even if the initial conditional statement fails and the “return
Geobits
php zend-framework views
I have a problem with Zend Framework 1.11.11. When I call a Action, the view is showing 3 times, like this:Test and script/action name indexTest and script/action name indexTest and script/action name indexIt occurs for all the ActionControllers. And in “views/scripts/test” there is de .phtml with only one sentence. I don’t know why. Could you help me? Thank you!this is my bootstrap.php<?phpclass Bootstrap extends Zend_Application_Bootstrap_Bootstrap {/*** Loading configuration from ini file*
Rohit Kumar Choudhary
cakephp views
I am using cakephp 2.1 when i am creating add function in controller and view add.ctp i am getting this error:Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ‘,’ or ‘;’ in C:\wamp\www\rohitchoudhary\caketoodoo\app\View\tasks\add.ctp on line 5Please help me
user28785
modules
Now pretend I am a three year old. How do I reverse this?Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or ‘(‘ in /home/supauto/public_html/sites/all/modules/gmap/gmap.module on line 8
ChrisF
modules
I use .Net and C#.I have the following code in some module:DateTime validFrom = Convert.ToDateTime(validFromTxt.Text);This makes (in my opinion) the implicit assumptionsthat there is text in validFromTxt.Text that it is possible to convert this into type DateTime.My question is, may the module make these implicit assumptions (due to “knowledge” of context of the page) or would it be better to check them before the command?
kiamlaluno
modules forms form-submission
I have a menu callback, and I want to add a form on it using the following code.function parking_calculator_menu() {$items[‘admin/parkingcalculator’] = array(‘title’ => ‘Node parkingCalculator’,’description’ => ‘Adjust node parkingCalculator options.’,’position’ => ‘right’,’weight’ => -5,’page callback’ => ‘get_form’,’access arguments’ => array(‘administer site configuration’),);return $items; }function get_form() {$form[‘short-term-parking’] = array(‘#title’ => t(‘Short ter
MPD
modules community-drupal-org dependencies
I have a module on drupal.org that is currently just has a -dev branch. The module feature detects for another module, and uses it if available. Otherwise, it can safely ignore it. In other words, it is not listed a dependency in the .info file.A bug report came in, and it looks like I may need to make this a proper dependency.Is there proper way to handle this situation which minimizes people breaking sites if they update?
SMC Tech
modules users entity-api postgresql
I just migrated the site from sqlite to Postgres, using the drush portabledb-import moduleI’m getting a error page only when no user is logged in to the site.I can get logged in using the login-link generated runningdrush user-loginand everything works great, all the content is there and accessible, views all work, etc… however log out and I get this message at the home page again The website encountered an unexpected error. Please try again later.and The watchdog-show reports thisID :
inizio
modules
Primary tabsView(active tab) EditStatus messageForum topic Comment form not working has been created. Posted by jassics on February 8, 2014 at 9:49pmI am facing problem in commenting over blog or forum contents. It is simply showing this error:ErrorThe website encountered an unexpected error. Please try again later. While checking error log I got this:EntityMetadataWrapperException: Unable to get the data property formatas the parent data structure is not set. inEntityStructureWrapper->getProper
Laxman13
modules
I am using Beauty tips module to show AJAX content on hover, But When first time it loads I am getting unexpected look. From second time onward I get correct look.I have attached an image of the problem.The code that I am using for this is : $options[‘bt_drupal_help_page’.$nodeid[$i]] = array(‘cssSelect’ => ‘#rating_’.$nodeid[$i],’ajaxPath’ => $base_url.’/average_rating’,’ajaxData’ => array(‘rating’=>$nodeid[$i]),//’ajaxLoading’ => ‘<blink>Wait Until It Loads…</blink>
kiamlaluno
7 modules hooks
Today I changed the weight of a custom module of mine in order to change the execution method of hooks (hook_form_alter). I’ve changed the weight to 1 value heavier than the other module’s weight. This seemed the safest thing to do instead of giving it a “random” weight of 100. The original module is a core module (translation) so I hope I didn’t break anything.When adjusting the weight of a module in order to change the execution order of hooks, what are the things to look out for and what are
optimusprime619
views modules
I am having trouble creating a new View. I am just testing out the module, but when I click “Save” after setting everything up, I receive the following error:PDOException: SQLSTATE[HY000]: General error: 1267 Illegal mix ofcollations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT)for operation ‘=’: SELECT s.uid, c.updated FROM {ctools_object_cache}c INNER JOIN {sessions} s ON c.sid = s.sid WHERE s.sid <> :session_idAND c.obj = :obj AND c.name = :name ORDER BY c.updated ASC; Array ([
abd
7 modules
I’m using Embedded Google Docs Viewer module,everything is ok except when viewing it’s showing like this:How can solve this problem?
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
Web site is in building
I discovery a place to host code、demo、 blog and websites.
Site access is fast but not money