texts:
I'm relatively new to Drupal and am just squashing bugs on my first site.

I have a region that I declared in my theme.info file:

regions[alert] = 'Sitewide Alert'

and I have a block that has a custom template block--alert.tpl.php with some custom fields. Everything works great when I have my Sitewide Alert block assigned to my Alert region. But when I disable my Sitewide Alert block, no content renders in my content region. If I enable the Sitewide Alert block, or any other block in the sitewide alert region, all my content comes back.

Using the themer module, I can see that all the same variables are still available on the page, but it's like none of my templates are being called or something. Can anyone help me troubleshoot this or point me to some resources?

UPDATE:

I forgot that I was preprocessing my custom block. This is where my issue was. Within my theme_preprocess_block function, I was running the following code:

// Sets the character limit for the Custom Block
if ($vars['id'] == '2') {
    $vars['content'] = truncate_utf8($vars['content'], 170, TRUE, FALSE);
}

What I found out is that the $vars['id'] changes depending on what blocks are called on the page. When my custom block was active, it's id was 2, but when it was inactive, my content block had the id of 2 and so was being truncated.

I changed this to:

// Sets the character limit for the Custom Block
if ($vars['theme_hook_suggestions'][0] == 'block__alert') {
    $vars['content'] = truncate_utf8($vars['content'], 170, TRUE, FALSE);
}

If anyone has a better way of selecting a block to preprocess I'd love to see it.


texts:
I've set up a Drupal 7 site locally and have ftp'd the site over to my ISP's server which is a linux box running PHP and MySQL.

I've never successfully logged into the remote site before and I have locked myself out as I got the admin password wrong.  When I go http://www.example.com/?q=user and click on request New Password then I get this error:

Not Found

The requested URL /user/password was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

One thing I've been confused about and that is the .htaccess file.  I never had one locally on my Mac and I did not need it (I know it is hidden) - so I downloaded one and deployed it to the web site but then I got 500 errors, it made it worse.

I've since deleted that file and at least I get some content - but not very much - just the front page.  I overrode the themes name in settings.php as I have user access errors when using a new template, if I get passed this bit I can probably fix that.  I changed it back to one of the default themes and that allowed me to get some content and not the 'white screen of death'

Advice welcome!


texts: Automated backreferences between taxonomies

texts:
Talking about DRUPAL 7, I've found some modules that manage automated backreferences between content types, but these are based on nodereference fields: i need something based on TERMREFERENCE.

I'll try to explain better:

I've a vocabulary (i'm talking about taxonomies, NOT content types) and I've added a termreference field type pointing to the same vocabulary. The scope is to have a "see also related terms" feature when someone is viewing a taxonomy term page.

What I need is a backreference between terms, so, when I add a term B as term reference on term A, automatically term A is also attached to term B as termreference itself:

term A -> Term B

Automatically I need a term back reference:

Term B -> Term A

How can this be done?

Thank you very much!

MXT


texts: How to filter on taxonomy term in a view?

texts:
I've got a view where I would like to filter content based on a taxonomy term. I've created the taxonomy, added some terms, created a field reference on the specific content type I'd like to show, then added some terms to content.

The issue I have is this: In the view, under add new filter, the taxonomy I created doesn't show up as an option to filter by. There's a bunch of "indexed node: xxx" available, but none of them refers to the taxonomy I created. I suppose there is an option somewhere to have the taxonomy terms indexed? How do I do this?

This might seem like a very straightforward question, but for some reason on this particular website, I can't find the culprit.


texts: How to display a block view if a page view has 1 single result?

texts:
The scenario is like this:

I have a page on which I have the header, the block in question, a lot of other stuff, and then the page view (its a table) that actually provides the route, the footer.

If the page view has one single row, I need to display the block view with some contextuals. Everything works (the results are ok, the contextuals are ok) except for the part where I need to check if the view page has one single result so I can display the block.

I am not sure how to go about that. I've tried some twig in my block view but I am not that knowledgeable with it.
I am looking for advice.

If it helps, the page and the block belong to the same view.
I am using Drupal 8.8.6.


texts: Installing and Running Drupal in Subfolder - Beginner

texts:
I am trying to do a redesign on a drupal site. I added a subfolder via an ftp client (example.com/devsite) and manually uploaded the extracted drupal7 files. One would think that going to example.com/devsite or example.com/devsite/install.php would be the next step in accessing the subfolder files, but im only getting 404/page not found error messages when i navigate to this URL.

I'm new to drupal and feel like this should be an easy fix...but dang is it frustrating. HELP!

I have read "How to get Drupal 7 installed in a sub-folder / sub-directory properly?" already - i'm having a difficult time deciphering what steps to take from this post. I need the original site example.com to be live, but example.com/devsite to be viewable as well.


texts: Share and update the structure (content types, vocabularies/tags, views, rules, …) for several sites

texts:
I want to start a Drupal 7 site, and it’s likely that in the future I need to run several other sites that should share the same modules, theme, configuration, content types, vocabularies and tags, views, rules, …. Apart from created nodes and things like the site name, they should be 100% copies, i.e., all changes should be applied to all current as well as all future sites.

It doesn’t matter if the userbase is shared or not. If it matters, all sites share the same second-level domain, i.e., every site has a subdomain.

As I start with only one site, I could make all changes to the structure (e.g., to node types or tags) right at this place. But as soon as there are two sites, I don’t want to have to replicate all changes for all sites.

How could I achieve this?

As far as I understand, the multi-site functionality would help with modules, but not with configuration or content types or vocabularies/tags, correct?

Should I create a custom distribution? Whenever I want to change something, I can change it in the distribution first and then automagically update it on all sites (without losing the already created content)?

Or should I use one site and, somehow (how?), divide the content into areas/sections so that it only appears on specific sub domains?

Or is there another way?


texts: Views Data Export not working as intended

texts:
I just installed Views data export module and its working fine. But after updating Drupal core from 7.34 to 7.36 it stops working as intended. Views also failed in slideshow module, libraries disappeared and impossible to create any views with download format.

Anyone know how to fix this? I need to export sales data from my website.


texts: How to have a field displayed depending on user's role in Views?

texts:
I use Views module to display the content of a custom entity with Page view (not Block view).
I'd like to have one field displayed only if the user has a certain role.
What is the best way to do that?


texts: How do I convert "entity:node/9 in a link?

texts:
I need to get some values from a custom block I've created, and I am using the following code.

// Get the block
$block = \Drupal\block\Entity\Block::load('hightlight');

// Get the block content
$uuid = $block->getPlugin()->getDerivativeId();
$block_content = \Drupal::service('entity.repository')->loadEntityByUuid('block_content', $uuid);

// Get the field value
$field = $block_content->get('field_link')->getValue()[0];

The problem is that the field contains entity:node/9. Is it possible to convert that value in a link?

This is the content of the field.


texts: Should magic quotes be on/off for Drupal 7?


texts: extract a field and the link to content from all nodes

texts:
i have a content type and it stores user_email,title,body etc.

Every node has a URL alias.

How can i go through all the node, and extract the email field + the URL of that node.

any clue  .
thanks


texts: How to Group fields, and duplicate them?

texts:
I'm trying to create a type of buzz feed website where you can make a list of items.

If you set the body field setting to unlimited.
You get a "Add item" button.

You can duplicate the body field as many times as you want.

I want to duplicate a set of fields using the "Add item" button

title, image, description as one item.

How can I do this?


texts: How to limit access to content to only users with the same role as the content author?

texts:
I'm having trouble in my Drupal the Views and I don't really know how to solve it.

Let's suppose that we have two roles named Org1 and Org2. We can have more than one user per role so for example:

A and B belong to Org1.
C belongs to Org2.

The trouble I'm having is that I want that the content posted by A is seen by all the users in Org1 (in this case A,B) but not the users that are in Org2 (C).

How could be this made? I'm new to Drupal but not to programming in general. I've tried several modules but maybe due to my ignorance I have not been able to make it work (so any suggestion would be great). Any programatically suggestion also would be great (but it will be first time programming in Drupal 7).

What I have currently in mind and would probably solve my problem I think that is to filter by the user is logged in (if I'm user A for example filter by Org1). How could this be done?


texts: Setting anonymous user timezone on page load

texts:
I'm developing a radio site where show times are displayed. Since it's an Internet radio station, I need to be able to display times in the user's timezone.

I'm able to detect which timezone a user is using (eg. Europe/London), but I don't know how to make Drupal use that timezone.

Is there any way to programmatically override Drupal's default timezone to instead use the timezone I detected?

I've looked through the documentation, but I have not been able to find a way for achieving this.


texts: Practical concerns for changing text on the "add to cart" in Drupal Commerce to use it as a "wishlist"

texts: Apologize for the roundabout question, just not sure how to get at this more directly. I'm developing a commerce site where our clients will be submitting inquiry lists that we will respond to, rather than orders. In essence, what I need is the shopping cart, minus the payment gateway (which is where the site is headed). As a quick fix, I was thinking of just changing the text on the "add to cart" and "check out" buttons, as the basic functionality we need is there out of the box without a payment gateway. Is there a glaringly obvious reason not to do this? I am developing a parallel wishlist application with flags, but I haven't hacked the functionality I need into that yet.


texts: Node teaser with a different size than other nodes

texts:
I have created a content type, and for some reason the teaser text has a different size than the size used by all the other nodes.

This is what happens for "Stenhousemuir For Sunday Success."

Could anyone enlighten me on why this happens?


texts: How to customize the "Remove" button in a multiple field (collection)

texts:
So, you have a field (collection, it's the same there) defined with unlimited values, and thus have an "add more" button and a row per distinct value. Let's call the field termine.

Now you have to theme the "remove" button in each row, e.g. to change the text to an imagebutton, and you wonder why your usual $form['field_termine']['und'][$k]['remove_button']['#value']="Kill"; in xxx_form_alter does not stick when adding another row via AJAX.


texts: Drupal + Solr, how to boost search results with updated date?

texts:
I'm trying to boost search results to give more relevancy to newly updated / created content. What I have tried is to use the following:

/**
 * Implementation of hook search_api_solr_query_alter
 */
function mml_search_search_api_solr_query_alter(array &$call_args, SearchApiQueryInterface $query) {
  // Boost by changed date. Fresher to top.
  $call_args['params']['freshness'] = 'recip(abs(ms(NOW/HOUR,ds_changed)),3.16e-11,10,1)';
}

But it doesn't seem to have any effect.

Any help would be appreciated.

Here is screenshot of solr admin side of the "field" Im trying to boost http://monosnap.com/image/A3c6WOGi71z0Smeke8tYgBbnoeNkyK


texts: Alter view plugin form in custom module files

texts:
I'm looking for the right method to modify an especific plugin views ui inside a custom module. The views plugin to alter is created by the module https://www.drupal.org/project/views_json_source
I want to hide the "json file" field, in the query options. And when the view is executed i want prefill this field with config data from my custom module.
Later i will need to create my custom exposed form using the json fields, but this is another story.
I think the right way is using the hook_views_plugin_option_definition_alter, but i've tested it in my module and it dont make nothing (drupal messages are not displayed).
The views json source have an plugin/views/query/ViewsJsonQuery with this code:
public function buildOptionsForm(&$form, FormStateInterface $form_state) {

  $form['json_file'] = [
    '#type' => 'textfield',
    '#title' => $this->t('JSON File'),
    '#default_value' => $this->options['json_file'],
    '#description' => $this->t("The URL or path to the JSON file."),
    '#maxlength' => 1024,
  ];

}

Somebody can help to the right way?
Thanks in advance.
PD.: I'm using Drupal 9.


texts:
I created a content type and added an image filed (machine name: field_theme_image).
Then, I've added a new content in this content type and uploaded an image. Now, I want this image to be shown in "page.tpl.php", so that this can be seen in all the pages. Please let me know how this can be done done.


texts: Export all views on a site to csv, json, spreadsheet etc

texts:
The Question.

How do I export a spreadsheet documenting all the views from a drupal site?

More info:

Say you want a summary of all the views on a site, perhaps you are going to rebuild them - maybe there is some iffy php_views in there. Maybe you are simply documenting a messy site that you've inherited.

While there is support for exporting individual views to various formats it is not as easy to export a comprehensive list of all your views to a spreadsheet.


texts: Add custom image styles to media browser display options

texts:
I'm using the Media module in a project.

I've defined several custom image styles and would like to add them to the list of display options in the media browser. However, I can't find a way to do so.

Reading through issues similar to mine, I found this thread which suggested using hook_styles_default_presets() to render the options. But even with clearing caches, I'm unable to get my custom image styles to display as formatting options.


texts: Unable to save term "Big Honor for Branford's Le Petit Café"

texts:
I was trying to save term with name "Big Honor for Branford's Le Petit Café" using taxonomy_term_save function which throws me the following error

PDOException: in drupal_write_record() in common.inc

Is it some thing related to character encoding  ? should i have to convert the character? I am not sure how to do that.

Please find the code that throws the error,

$term_name  = new stdClass();
$term_name->name = urldecode("Big%20Honor%20for%20Branford%27s%20Le%20Petit%20Caf%E9");
$term_name->vid = 1;
taxonomy_term_save($term_name);

If we are using the exact "Big Honor for Branford's Le Petit Café" is a file then i could not get the error but, when url encoded and decoded again, we will have the same character set.


texts:
I am trying to create a block to put on the search results page that has a list of the content types in the search results and the number of results for that content type.

Does anyone know how this can be achieved, if it can be?

So far I've tried hooking into _preprocess_search_results but that only works with the current page of the results.

Thanks for any help with this.


texts:
hope that you can help me.

Version: Drupal 6/7

i need information about a user dashboard.

we want to create a intranet solution with bug/ticket reporting/scrum functionality and need for a overview a User/Team overview (newest issues/newest tasks etc.). but i don't found any help/information about a user/team dashboard.

1.) can i set a dashboard as startpage?

Greets Frank


texts:
I am using rules and I'm trying to retrieve a field inside a field collection for my scheduled component.

I have the conditions "Entity has field" and have selected my field, but I still can't access it in the data selection for my component.

I am using Drupal 7.52, Rules 7-2.9, & Rules Scheduler 7-2.9.

Update I have discovered that I can access other fields in the fieldset, but I just can't access the date fields.


texts: Composer, git and update core and modules

texts:
I started working with Drupal 8 and tried to find out the best way for developing and administrating projects. As Drupal 8 with all its dependencies is very big (more than 60 MB) I like the suggestion not to commit all the Drupal core, modules and dependencies into a git repository but to let Composer deal these things. The idea is to set everything (Drupal core version, installed modules with their versions) in the composer.json, commit this file to a GIT repository and when a remote colleague wants to work on the project he/she just checks out the composer.json from the repo locally, starts composer install and all the needed PHP files (Drupal core, modules and dependencies) get downloaded (as far as I understand).

For me this seems to be an interesting way to start new projects but I feel that this could be some kind of bottleneck for the everyday project management. For example when I define the modules and the core in composer.json usually it seems to be done in a more general way in terms of the version. Usually not the specific version seems to be defined in composer.json:

"drupal/core": "8.0.*"

When I start composer install locally earlier as my colleague he/she might get a newer version of Drupal which may lead to different behaviors of our working copies (although it should not with regards to versioning rules - I know). But if we define a specific version:

"drupal/core": "8.0.0"

so we can be sure that every remote colleague will have the exact same version we can not use composer update to update to newer versions automatically - we would need to look for the latest version and change the version in composer.json manually.

The same appears with contributed modules or themes.

To be honest, I never worked with Composer before; maybe someone with more composer experience could explain to me how to deal with these issues.


texts: Overriding fields from one content type which inherit from another content type

texts:
Imagine we have 50 different professions in the same domain (medicine for example). In a region, we can have 5 doctors who have the same addresses, and in another region we can have 15 doctors in different addresses. We want their information to be stored in the database (e.g. addresses, telephone number).

So I decided to do this:

Content type 1 (general information): title, field_region, field_tel, field_email, etc.
Content type 2 (specific information): title, field_region, field_inherit_from, field_tel, field_email, etc.

Thus, when we want to add specific information to a profession X from region Y, we have to create a new content of content type 1 and then create content type 2 which will override specific fields from content type 1.

Keep in mind that a same region may have 10 professions who have same phone number, same email address but 7 professions have its own email address for instance.
Also, keep in mind that there is more than 15 different fields (so 10 different type of information about the professions).

How can I do this? I just don't know what the best way to do it is.


texts: Allow VIEWS accessing PARAGRAPHS fields collection

texts:
I have a content type called "Slideshow" where users can create any number of "slideshow" nodes.
This content type has a field called "Slide" which is a field collection of other fields (caption, image, description, and link). The user can add multiple "Slides" to each "Slideshow" node  (I can achieve this with the help of either PARAGRAPHS or FIELD COLLECTION modules).

Then I use VIEWS to create Blocks of the "Slideshow" content type to display specific nodes using contextual filter Nid.

MY PROBLEM IS:
In VIEWS I can only list "title" and "slide" fields (as  rendered) of the "slideshow" content type, whereas I need to list the fields inside the "Slide" field (the caption, image, description and link) so that I can customize them using VIEWS.
Is there any way to achieve this? (allowing VIEWS to access the fields of PARAGRAPHS module).

POSSIBLE SOLUTIONS:
In VIEWS I added a relationship "Slide", this allowed me to list the fields inside "Slide" field. the problem is that I'm trying to avoid relationships as it uses a lot of LEFT JOINS and this may decrease performance.
my website uses lots of these slideshows and galleries multiple time in the same page and I don't want to lose performance.

Any help will be much appreciated.


texts: Why is the Downloading file size unknown despite Content-Length headers set with file size in bytes?

texts:
During Downloading files the size is unknown "0B" despite having set the "Content-Length" headers with the bytes (see $http_headers below)

Content-Type (String, 15 characters ) application/zip
Content-Disposition (String, 55 characters ) attachment; filename="test.zip"
Content-Length (Integer) 454732390
Pragma (String, 8 characters ) no-cache

FYI - code for file transfer (using Taxonomy File Tree)

$file = file_load($node->tft_file[LANGUAGE_NONE][0]['fid']);
    $http_headers = array(
      'Content-Type' => $file->filemime,
      'Content-Disposition' => 'attachment; filename="' . $file->filename . '"',
      'Content-Length' => filesize($file->uri),
    );
    if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
      $http_headers['Cache-Control'] = 'must-revalidate, post-check=0, pre-check=0';
      $http_headers['Pragma'] = 'public';
    }
    else {
      $http_headers['Pragma'] = 'no-cache';
    }

file_transfer($file->uri, $http_headers);

Is the format wrong or am I missing something?


texts: Drupal 7 views comparing two range dates

texts:
I have a content type which has a date field indicating a period of date, and I want to be able to filter a view with a date range within a single exposed filter with these 4 criteria:

input start date <= content start date & input end date >= content end date
input start date <= content start date & input end date <= content end date
input start date >= content start date & input end date >= content end date
input start date >= content start date & input end date <= content end date

I've tried installing views between dates filter but it only works if I have a single date, not a date range. Any suggestions?


texts:
I have a website where I publish book reviews. For each book I publish 2-3 quotes from the book. I'm using the following fields as taxonomy, so that when a user clicks on them he/she can find more content of that category.

Book name
Author name
Publisher

Lets say, over the period of time, I add reviews of about 5000 books, then there will be 5000 taxonomy terms for "book name". Same for the other categories.

My question is, are these too many taxonomy terms for Drupal? Or is there a better way of doing this. All I'm trying to do is, when a user clicks on author's name, he/she can find more content from that author.


texts: Display external link using theme settings

texts:
I'm using theme-settings.php to store links to external pages (like Facebook, Twitter, etc.) and the links aren't storing correctly. In theme-settings.php, I have:

function mytheme_form_system_theme_settings_alter(&$form, $form_state) {
 $form['mytheme_facebook'] = array(
'#type'          => 'textfield',
'#title'         => t('Facebook Link'),
'#default_value' => theme_get_setting('mytheme_facebook'),
'#description'   => t("Appears in sidebar block."),

);

On my Theme Settings page, I enter https://www.facebook.com/ in the "Facebook Link" field. When I hit save, I see that only "www.facebook.com" has been saved in that field.

So, when I call the field on my site, using

print theme_get_setting('mytheme_facebook');

the link that gets outputted is http://www.myurl.org/www.facebook.com/.

How can I get I get rid of the "myurl" stuff, so I get a working link to Facebook? Oh, and I'm using Drupal 7, if that helps.

Thanks in advance for any tips!


texts: Is there an hook to modify programmatically the thumbnail shown from the video module?

texts: I'm using the video module and i need to show a different thumbnail if the user who is watching the node is a guest or a logged on user (if the user is a guest i want to display a standard thumbnail). Is there an hook to do this?


texts: Display a particular field in a view by a comma separated values using custom code

texts:
For a partular view  say "abc" I have created a view.

Now I want a particular field in that view as comma separated values.

How can I achieve this. Can I do this with custom coding only for that particular field.

I am learning drupal custom coding. so If this is possible through custom coding Please give me sample code.

Thanks in advance


texts: array_flip(): Can only flip STRING and INTEGER values with nested Field collection

texts:
I'm getting the error Warning: array_flip(): Can only flip STRING and INTEGER values! in EntityAPIController->load() when using a field collection in another field collection.

Is this a bug in Field collection or the way I load the entities?
Either way: How can I solve the warning?

Here's a simplified version of how I load my entities and sub-entities:

foreach ($node->field_chapter[$language] as $chapter) {
    $items = entity_load('field_collection_item', $chapter);
    foreach ($items as $item) {
        //Some echo's from fields in $item
        foreach ($item->field_paragraph as $paragraphItem) {
            $paragraphs = entity_load('field_collection_item', $paragraphItem);
            foreach ($paragraphs as $paragraph) {
            //Some echos in paragraph
            }
        }
    }
}


texts: Where are the RESTful module permissions other than `Administer REST resource configuration`?

texts:
According to the tutorial An Introduction to RESTful Web Services in Drupal 8, the admin/people/permissions path should contain the following permissions:

But now that I installed the latest version of Drupal, the big surprise is on my website there are no other RESTful module permissions than Administer REST resource configuration, no permissions to grant DELETE, GET, PATCH or POST to each role.

I have Enabled all core web services modules (HAL, HTTP Basic Authentication, RESTful Web Services, Serialization) + REST UI module.

Are those permissions removed from Drupal 8.2.5?


texts:
In Drupal 8, if I create a node, add a menu link, save it, then go back and edit the menu link title in the node, the breadcrumb title does not update until I clear the cache.

How can this be set so it reflects this change without requiring flushing the cache?


texts:
I'm in charge of a website for my company, which runs Drupal 7.66 (PHP 5.3.3), for a few years now. Since a few months, I discovered a strange behavior regarding the robots.txt file. In some case, the encoding is totally messed up.

Here is a brief description of the problem:

If I am connected to the website: no problem, the robots.txt file is well displayed in the browser
If I am NOT connected to the website (like all our users and the search engine robots): it randomly appears broken, and I identify that as an encoding issue. By “randomly”, I mean that sometimes when I check the robots.txt while not being connected, its ok, but sometimes it's broken. I can't find a pattern that will allow to reproduce the error.

The robots.txt is managed through admin/config/search/robotstxt thanks to the module RobotsTxt version 7.x-1.2

Here is a screenshot to illustrate the issue (I had to hide some parts of the images):

Of course, the webmarketing team noticed me that Google can't crawl the robots.txt file because of that issue:

I made quite a lot of searchs on drupal.org, Stackoverflow, Google... but couldn't find anything related.
I am not a developer, but I work with a guy which is specialized in Drupal and he can not figure it out either.

Any idea? Of course if you need any further information, please let me know.

Thank you.


texts: Is it possible to take a contact form and embed it into a page.html.twig or node.html.twig file? Or is the form only accessible via its contact/machine_name link?


texts: Is it possible to establish case roles other than client and manager with webform-civicrm integration?

texts: So I have a case definition that besides the client and the case manager, also includes a navigator, referral and provider roles.  The webform works great for everything, including establishing the relationships for the other roles outside of the case (shows up in Other Relationships in the case view), however I can't see a way to flag those relationships as case roles, is this possible?  Perhaps it is even possible via Rules, which I started to look at, but I have not yet been able to figure out how to make it work.


texts: Page slide animation with horizontal anchor navigation

texts:
I want to realize a project with sliding pages (horizontally or vertically) similar to the one shown on www.viasko.de.

Is that possible with Drupal due to a different navigation concept via anchors, and not with urls? Does the URL dispatcher allow anchors?


texts: How to send a form back a step in a multistep Webform

texts:
I am trying to figure out how to programmatically boot a user back to an earlier step if they fail validation or submission on one of the final steps of a form. The form has to check some remote service calls before accepting the submission.
I tried to add a validate hook and try something simple:
function mymodule_schedule_validate($form, FormStateInterface $form_state) {
  $page = $form_state->get('current_page');

  if ($page == 'step_2') {
    $form_state->setErrorByName('tour_date', 'Pick some other thing or whatever');
    $form_state->set('current_page', 'step_1');
    $form_state->setRebuild();
    #$form_state->setRedirect(new RedirectResponse(\Drupal\Core\Url::fromUserInput('/form/schedule')->getRouteName()));
  }
}

While the code is hit when step 2 is submitted, and it sets current page to step_1, nothing else happens. The error appears, but the form displayed in the modal is still step 2. I tried with and without the redirect.
How can I manipulate the form this way?


texts: Given an $entityTypeId as string, how can I determine if this entity type is fieldable? That is, if entities of that type implement FieldableEntityInterface?


texts:
I am using drupal 7 built in form name user_register_form, when clicked on submit or save button I want to store the value of uid column value  and status value (if the request is active or blocked) to be stored in another table? How can I implement this , can anybody please guide me ..

UPDATED
My table name is expiry_user, expiry_status and expiry_uid are two columns in my table

function mymodule_user_insert(&$edit, $account, $category)
{
db_insert('expiry_user')->fields(array(
'expiry_status' => $account['status'],
'expiry_uid' => $account->uid,
))->execute();
}


texts: Hook menu url giving access denied for post method but working for get method

texts:
I defined a custom url using hook_menu and a custom delivery callback that returns json output.

I wanted the url to work on the post method but it is giving access denied for requests done using the post method but it is working without issues for get method.

How do I debug and see why post methods are being denied access?

/**
 * @file
 * Implements menu functions for returning json output.
 */

/**
 * Implements hook_menu().
 */
function mymodule_menu() {
  $items['api/json/select/programs'] = array(
    'access callback' => TRUE,
    'access arguments' => array('access content'),
    'page callback' => 'mymodule_api_return_aid_program',
    'delivery callback' => 'mymodule_api_json_output_wrapper',
    'type' => MENU_CALLBACK,
    'access callback' => TRUE,
  );
 return $items;
}

/**
 * Custom page callback function - Retuns the uid of the user on passing
 * valid username and passowrd returns error otherwise
 *
 * @return $uid
 *   Uid of the user on success, NULL if other wise
 *
 * @return $status
 *   success of the user on success, failure if otherwise
 */
function mymodule_api_return_aid_program() {
  try {

    // Fetching the primary parameters
    //product code
    $product = $_POST['product'];
    //country code
    $country = $_POST['country'];
    // language code
    $language = $_POST['language'];

    // age
    //citizenship
    // veteran_status
    $values = _find_product_specific_to_country($product, $country);

    return array('message' => array('nodes' => $values));
  }
  catch(Exception$e) {
    return array('status' => FALSE, 'message' => $e);
    watchdog('Aid API ERROR', $e);
  }
}

/**
 * Custom delivery callback function
 *
 * @param $var
 *   The argument to the delivery callback function
 *
 * @return array
 *   Contains json encoded format of $var on succes,
 */
function mymodule_api_json_output_wrapper($var) {
  // If the access callback is FALSE
  // it will pass MENU ACCESS DENIED to the
  // delivery callback function
    //return drupal_json_output($var);
  if ($var == MENU_ACCESS_DENIED) {

    return drupal_json_output(array('status' => FALSE, 'message' => 'Invalid Token. Access Denied'));
  }
  else {
    return drupal_json_output($var);
  }
}
e


texts: Cannot configure the site as SAML SP with simplesamlphp_auth

texts:
I have a functioning SAML IdP, implemented with LemonLDAP::NG. I know it functions because it works with Nextcloud as an SP. I've also successfully configured a DokuWiki SP in the past.

The IdP, the Nextcloud SP and the Drupal 8 SP are all behind an Nginx reverse proxy. All of them are directly reachable from my IP, but I have restricted access from other IPs.

I have been trying on and off for a year to make SAML login work with Drupal 8, using simplesamlphp_auth, but without success. I have lost count of how many articles I have read on the net, which all suggest that configuring SAML is trivial. Sadly, not for me.

Currently, when I select the Drupal 8 SP under 'Test authentication sources' in the 'Authentication' tab, I get the following error:

  Too many redirects occurred trying to open “https://www.xxxx.tld/simplesaml/module.php/core/authenticate.php?as=wmh-www-sp&%5CSimpleSAML%5CAuth%5CState.exceptionId=_568428306a7ad7ad7bf8f8f47a94940de364239c67%3Ahttps%3A%2F%2Fwww.xxx.tld%2Fsimplesaml%2Fmodule.php%2Fcore%2Fas_login.php%3FAuthId%3Dwmh-www-sp%26ReturnTo%3Dhttps%253A%252F%252Fwww.xxx.tld%252Fsimplesaml%252Fmodule.php%252Fcore%252Fauthenticate.php%253Fas%253Dwmh-www-sp”. This might occur if you open a page that is redirected to open another page, which then is redirected to open the original page.

The log file contains repeated occurrences of the following error messages:

  2019/04/03 22:31:48 [error] 21251#21251: *982 FastCGI sent in stderr: "PHP message: simplesamlphp DEBUG [e54b9408f4] Session: 'wmh-www-sp' not valid because we are not authenticated.

  PHP message: simplesamlphp DEBUG [e54b9408f4] getIdpMetadata: METADATANOTFOUND('%' => '\'https://cloud.xxx.tld/saml/metadata\'')

  PHP message: simplesamlphp DEBUG [e54b9408f4] getIdpMetadata: METADATANOTFOUND('%' => '\'https://cloud.xxx.tld/saml/metadata\'')

  PHP message: simplesamlphp DEBUG [e54b9408f4] Saved state: '_f37c552249cf34b640de1dac7ad22b1481c763fc0f:https://www.xxx.tld/simplesaml/module.php/core/as_login.php?AuthId=wmh-www-sp&ReturnTo=https.xxx.tld.php.php-www-sp'

  PHP message: simplesamlphp DEBUG [e54b9408f4] saving key SimpleSAMLphp.session.161a8f86a89cf6e93f36117cc21a26af to memcache" while reading response header from upstream, client: NN.NNN.NNN.NNN, server: www.xxx.tld, request: "GET /simplesaml/module.php/core/authenticate.php?as=wmh-www-sp HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-www.sock:", host: "www.xxx.tld", referrer: "https://www.xxx.tld/simplesaml/module.php/core/authenticate.php"

  2019/04/03 22:31:48 [error] 21251#21251: *982 FastCGI sent in stderr: "PHP message: simplesamlphp DEBUG [e54b9408f4] loading key SimpleSAMLphp.session.161a8f86a89cf6e93f36117cc21a26af from memcache" while reading upstream, client: NN.NNN.NNN.NNN, server: www.xxx.tld, request: "GET /simplesaml/module.php/core/authenticate.php?as=wmh-www-sp HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-www.sock:", host: "www.xxx.tld", referrer: "https://www.xxx.tld/simplesaml/module.php/core/authenticate.php"

(www.xxx.tld is the SP, cloud.xxx.tldis the IdP, wmh-www-sp is the entityID of the SP.)

Specific things I do not understand:

we are not authenticated - I have logged into the simplesamlphp_auth interface
METADATANOTFOUND('%' => '\'https://cloud.xxx.tld/saml/metadata\'') - this is the address of the IdP's metadata and is correct as such

I created file metadata/saml20-idp-remote.php from the IdP's metadata URL, https://cloud.xxx.tld/saml/metadata using simplesamlphp_auth's metadata converter under the "Federation" tab.

Can anyone help me to make sense of all the above?

Steve


texts:
I've got a view which represents a list of redirects. The view has two fields:

'Destination'
'Source'
'Hash' (an indexed has based on the destination)

I'd like to generate a view which lists destinations along with the number of times a visitor has been redirected to that destination. If I were to write the SQL myself, I'd simply do:

SELECT destination, count(*) as redirects FROM redirects GROUP BY hash

However, no matter what I do I can't get Views to ONLY group by hash. This is what I've done:

Enabled aggregation (Advanced > Aggregation>
Enabled COUNT on the 'source' field.

What happens now is that Views COUNT on the 'source' field, but groups on both the 'destination' AND 'hash' field:

SELECT destination, hash, COUNT(source) FROM redirects GROUP BY destination, hash

How do I get Views to only GROUP BY the 'hash' field?


texts: Attaching the comment form programmatically

texts:
How do I add the comments form (of the comments module) programmatically in a custom-made module?
In other words, what proper code should be added to your module code to add a complete "Post New Comment" form (of the Comments core module)?

That said, how do I force the installation of the Comment module with the installation of your own module?

I'm re-asking my question in an edited version with some new results i've reached :).
I've created a custom menu in a custom module of mine, with items of course.
I wanted to add the comment form (of the Comment module) to the page that my item takes me to.
The problem is that the page i'm redirected to is not a node, but it is a render-able page that displays the data according to it's 'page_arguments'.
It is as follows:

$items['car/%'] = array(
        'title' => 'Cars',
        'page callback' => 'car_page',
        'page arguments' => array(1),
        'access callback' => TRUE,
        'type' => MENU_CALLBACK,
);

I want to attach the comment form (of the Comment Module) to that page.
I used the following code:

module_load_include('module', 'contact');

$build = array(
    'header_text' => array(
        '#type' => 'markup',
        '#markup' => 'Building comments in page.',
    ),
    'the_form' => drupal_get_form('comment_form', ''),
);

return $build;

All is correct code.

But the problem is that the comment form and the posted comments are loaded depending on the node Id (nid), and in my case there is no node Id (nid)!

How could i assign a specific identifier of that custom page so that the comment form functions correctly and comments related to that page are correctly loaded?!

And in the code above, i managed to call the form using drupal_get_form(), and assigned an empty second argument! I don't think that's right, right?

Any ideas!?


texts:
When I create a new field programmatically, drupal create a default schema for my being added and for each new field added is create a new database schema.
I noticed that the columns always have the same structure except for the last column 'FIELD_NAME_value'.

entity_type | bundle | delete | entity_id | revision_id | language | delta | FIELD_NAME_value

I have many fields that have the same "entity_type" and "bundle".

Can I create programmatically a single schema that contains all of them?

Thanks!


texts: How to position an element using jQuery UI .position method?

texts:
I'm going on about 20 hours trying to get jQuery UI to work, and fortunately, I'm still not frustrated. I just really want it to work. I would like to use the .position method to position an element in the top right corner relative to #page, (http://api.jqueryui.com/position/).

I'm not sure which version of jQuery this method requires, so I'm using the newest version, 1.10.2. It wasn't so hard to implement. I'm using the jQuery Multi module, and my script uses the alias as per instructions. (I tried using the jQuery Update module, but that just seemed to break everything, so I found jQuery Multi).

This part seems to be working. The file, jquery-1.10.2.min.js, shows up in the head of my HTML parallel to Drupal 7's 1.4.4 version. I'm getting an alert message when I write a test alert so it seems to be finding the function. If I delete the jquery-1.10.2.min.js file, the alert quits working and when I add it back it works again, (after clearing caches).

I've added the jquery.ui.core and jquery.ui.position libraries from Drupal core (both versions are 1.8.7) using drupal_add_library() in a preprocess page function. Like this...

function marigold_zen_preprocess_page(&$variables, $hook) {
  /* Add jQuery UI libraries - http://jqueryui.com/ */
  drupal_add_library('system', 'ui');
  drupal_add_library('system', 'ui.position');
}

Both of these files show up in the head of my HTML also.

Now I add the code to test out positioning the submit button in the top right corner of the page...

(function ($, Drupal, window, document, undefined) {
  $(document).ready(function() {
  //  alert("This is working");
    $( "#edit-submit" ).position({
      my: "right top",
      at: "right top",
      of: "#page"
    });
   });

})(jq1102, Drupal, this, this.document);

Nothing happens, and I get no errors in the console. Nothing is positioned differently. Again, if I uncomment the alert, it shows when I refresh the page, so I think that means that it's reading the function, yes?

If anyone can help me out here, I'd be so incredibly grateful. I was up till past 4am yesterday, woke up about 8am, and I've been at it all day again today. It's nearly dinner time, and I'm still stuck.

P.S. - Drupal 7.24


texts: Drupal Rules: How do I check if node is updated via edit form or via VBO?

texts:
I'm trying to build a reaction rule that fires on the event After updating existing content, but with the condition to only run after the node has been manually updated using the node edit form, not as part of a Views Bulk Operation action that updates nodes.
My issue is I can't find a condition that achieves this.

Does anybody have an idea? Thanks for thinking along :-)


texts: Search API- SolR - Processing solr response in drupal

texts:
I'm currently trying to find a function that process SolR response to a query that is sent with the search method of SearchApiSolrConnection class.

Here is how the search is done:

  $values = $_GET['search'];
  $options = variable_get('MY_OPTIONS');
  $solr_connection = new SearchApiSolrConnection($options);
  $q_request = FUNCTION_PROCESSING_REQUEST($values);
  $params = array(
    'q' => $q_request,
    'start' => 0,
    'rows' => 10000,
    'fq' => array(
      ''
    ),
    'fl' => '*,score'
  );
  $result = $solr_connection->search(null, $params);

The SolR core indexes content from SolR and other databases. I wondered if there was a functionality that processes the response to a more Drupal friendly variable (a renderable array or an key-value array). Today I have variables that look like : im_node$field_my_field.

Is it possible to transform this variables into ones that are like node:field_my_field instead of im_node$field_my_field?

Any help would be appreciated.


texts: how to override function in display suite extras

texts:
I'm looking for a way to override a few things in Display Suite Extra's ds_search_extra_variables function. Easy enough to update the module directly, but I'd prefer to override it in template.php or as part of a custom module if possible, just haven't had any luck with getting the site to recognize overrides (ex. THEMENAME_ds_search_extra_variables in template.php or MODULENAME_ds_search_extra_variables in a custom module).

Here's what I'm hoping to accomplish:

make some minor adjustments to the language in "Your search for XYZ gave back..."
avoid the 'Your search for "" returned...'
clean up character encoding issues like 'Your search for ""%40the" gave back..."

I did try overriding a couple of other functions (those that call ds_search_extra_variables), but I pretty quickly ended up with a large chunk of hte extras module in my custom module and still wasn't seeing any progress.

Any advice regarding how to get this working would be much appreciated.

Thanks!


texts:
I am experiencing a rather odd problem in Drupal 7.

I have a form in Ctools modal. It should contain 2 dependent select boxes (among other fields). I've done this dozen times on regular forms, but i can't make it work in the Ctools Modal form. Modal pops up, all the fields are there, all the counties are in the first select box, but it looks like it's not even reaching the ajax callback when a county is selected, so no dealer are returned. When I hard code the county id, dealers from that county show as expected.

My code is similar to the following:

menu item:

$items['modal-data/%ctools_js'] = array(
  'page callback' => 'core_modal_form',
  'page arguments' => array(1),
  'access arguments' => array('access content'),
  'delivery callback' => 'ajax_deliver',
  'type' => MENU_CALLBACK,

);

general modal handling:

function ni_core_modal_form($js) {

// Check whether js is enabled.
if ($js) {

  // Include ctools modal plugin.
  ctools_include('ajax');
  ctools_include('modal');

  // Create notify entity
  $form_state = array(
    'title' => 'Contact dealer',
    'ajax' => TRUE,
  );

  $commands = ctools_modal_form_wrapper('contact_dealer_modal_form', $form_state);

// If form was submitted.
  if (!empty($form_state['executed'])) {

    $commands[] = ajax_command_replace('#modal-content', theme_status_messages(['display' => 'status']));

  }

  print ajax_render($commands);
  drupal_exit();
 }
}

The form in ctools modal:

function contact_dealer_modal_form($form, &$form_state) {

   // get all counties
  $counties = get_dealer_counties_list();

  // Check for the selected county
  $county = isset($form_state['values']['county']) ? $form_state['values']['county'] : key($counties);

  // get dealer for selected county
  $dealers = get_dealer_select_list($county);

  $form['wrapper'] = [
    '#type' => 'container',
    '#attributes' => ['class' => ['contact-dealer-form-wrapper']],
  ];

  $form['wrapper']['county'] = [
    '#type' => 'select',
    '#title' => t('Select your county'),
    '#options' => $counties,
    '#ajax' => array(
      'callback' => '_county_dealer_callback',
      'wrapper' => 'dealer-replace',
    ),
  ];

  $form['wrapper']['dealer'] = [
    '#type' => 'select',
    '#title' => t('Select your dealer'),
    '#options' => $dealers,
    '#default_value' => 0,
    '#prefix' => '
',
    '#suffix' => '
',
  ];

  $form['submit'] = [
    '#type' => 'submit',
    '#attributes' => ['class' => ['btn btn-primary'] ],
    '#value' => t('Contact'),
  ];

  return $form;
}

ajax callback:

function _county_dealer_callback($form, &$form_state) {

  return $form['wrapper']['dealer'];
}

I will highly appreciate any suggestion!


texts: Retrieving users from Database on to forms

texts:
I have a webform with a select option type field. I need an authenticated user to view other available users in the website in this list. So, it needs to be dynamic by communicating with the database. What is the best way to do this?

Thanks in advance!


texts: How can I override apache solr's default search result sorting?

texts: According to this, search results are ordered by relevance score. How can I override this? I want our results sorted by created date. I'm not talking about allowing users to sort by different fields, just the default order of results returned by apache solr.


texts: Give flagged products in search API a higher search score?

texts:
I have a product catalog running on Search API and Search API SOLR Search. Now I was hoping that when a customer flags a product (with the flag module), there would be a way to boost the search score of that particular product.
So that when it is flagged as favorite it will float to the top, but only for that specific user.

How to alter Search API search scores so flagged items will have a higher score?


texts:
Hopefully there is something out there to do what I want. I imagine my terminology is off hence why my googling is failing.

I have two content types.

Album & Track.

I want to create a new Album. When creating an Album I want to be able to reference tracks to it. I know I could create the tracks first then use the entityreference module to add those tracks to the album.

What I want to do is to create the Tracks on the fly. So have an Add track button, fill in the fields for track and then for it to be associated with the album.

For my purpose Track does not need to be it's own content type but I need to able to capture more than one field when pressing the add button.

Any ideas if there is anything out there for this?

If not I can try hacking together something in code.


texts: List of parent and child taxonomies and related content

texts:
I would like to show in the front page a list of dishes. Like a real restaurant menu, I would like see:
Wines

 -Whites

  --Product 1

  --Product 2

 -Reds

  --Product 3

  --Product 4

Beers

 -Blondes

  --Product 5

 -Reds

  --Product 6

and so on.
To do so, I created a taxonomy vocabulary named category and then a list of terms and sub-terms like this:

Then in my custom type Product I created a relation field to the taxonomy category.
But when I tried to create a custom view to list all the products by taxonomy terms and sub-terms, I only view the child one.
How can I create the view to display the complete hierarchy list?
Thanks


texts: How to add a form to $node in hook_node_load()?

texts:
I want to add a form to a node before it is passed along to the theme layer.

My module has a hook_node_load, as follows:

function gp_shop_node_load($nodes, $types) {
  foreach($nodes as $nid => $node) {
    //Determine if we should process. aka: only run on Record->type() types.
    if (!in_array("product", $types)) {
      continue;
    }

    $nodes[$nid]->gp_shop_order_button = "[BUTTON]";
  }
}

This works: the text [BUTTON] is added to $node if it is type "product";

However, when placing an actual form, it breaks in a Maximum function nesting level of '100' reached, aborting!-error. An endless loop of some sorts. As follows:

    $nodes[$nid]->gp_shop_order_button = drupal_get_form("gp_shop_order_button", $node);

Edit: In the final code, I problably have to wrap this in a drupal_render() even; for now it makes no difference. The relevant line would then be:

$nodes[$nid]->gp_shop_order_button = drupal_render(drupal_get_form("gp_shop_order_button", $product));

And then with the callback-hook for the form.

function gp_shop_order_button($form, &$form_state, $node) {
  $form = array();

  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Order',
  );

  return $form;
}

The part about passing along the $nodeis not very relevant and is not causing the problem. Just left it in my examples here, to illustrate that passing along parameters is a requirement.

What am I doing wrong?


texts:
Please forgive me for asking an open ended question.

Are there various resources that explain WHY different changes were made? I'm getting used to the idea of YAML and TWIG files. I'm just struggling to understand WHY they moved. I'm supportive of learning a new way.

To me, it seems like they took the old TPL files which were decently easy to understand and replaced them with the alternate syntax from TWIG.

What is the functional/practical benefit? is there something I can read or watch to get it?


texts: Seeking a Better way to Create a Collapsible Fieldset

texts:
I'm creating a collapsible fieldset on my home page and have put the following code in a block (structure > blocks):

<form>

    <fieldset class="collapsible form-wrapper">
      <legend>
        Legend
      </legend>

Content

    </fieldset>

</form>

It actually works what I did using the 'Full HTML' text format. I did it this way though only because I don't know the preferred way.

I imagine this would normally be done (for security reasons or something...) by creating a module or via a preprocess function.

Am I wrong to second guess myself here? Maybe it's standard practice to do what I've done above.

Any guidance is appreciated. Thanks.


texts: Programmically add multiple empty fields on a multiple value field/form

texts: In Drupal 7,  When you set a field "Number of values" to unlimited, it will show you 1 field on the creation page with an add more button.  How would one go about so it shows 5 empty fields on the creation page?


texts: How to show comments belong to each paragraph, under that paragraph?

texts:
I am writing a module that gives this option to users to put comment on each paragraph.

So I have added a new field to my comment table, called "paragraph_id".Also in comment form I have added a new field which asks users which paragraph do they want to put comment on.

I have done some changes to node.tpl.php. This is part of it:

<div class="content clearfix"<?php print $content_attributes; ?>>
<?php
  // We hide the comments and links now so that we can render them later.
  hide($content['comments']);
  hide($content['links']);
  $paragraphs = explode("
",render($content));
  $number = count($paragraphs);

 if($teaser){

   print render($content['links']);

 }

 if($page){
          $node_number=$node->nid;

 print render($paragraphs[0]);

 for ($i=1;$i<$number;$i++) {

    print render($paragraphs[$i]);

      Put comment for Paragraph <?php echo $i?>

        <?php

    }
  ?>

 <?php print render($content['comments']['comment_form']);

so you can see that there is a link under each paragraph that when they click on it, it will take them to the comment form. So now I want to show the comments that belong to each paragraph under that paragraph.

When I use this:

krumo($content['comments']['comments']);

This is part of what I see:

   ...(Array, 11 elements)

  #sorted(Boolean ) TRUE
   22(Array, 13 elements)
   26(Array, 13 elements)
   25(Array, 13 elements)
   28(Array, 13 elements)

when I check the comment table, I find out that 22,26, 25, .. are cid numbers from comment table.
And if I click on for example 22, this is part of what  I will see:

    #pre_render(Array, 1 element)
    #entitly_type(String, 7 characters ) comment
    #bundle (String, 20 characters ) comment_node_article
    links (Array, 4 elements)
    #view_mode (String, 4 characters ) full
    #theme (String, 21 characters ) comment__node_article
    #comment (Object) stdClass
    #node (Object) stdClass
    #language (String, 2 characters ) en
    #prefix (String, 24 characters )
    #weight (Integer) 0
    #children (String, 1520 characters ) <div class="comment comment-by-node-author comm...
    #printed (Boolean) TRUE

And if I click on #comment, this is what I will see:

     cid (String, 2 characters ) 22
      pid (String, 1 characters ) 0
     nid (String, 2 characters ) 22
     uid (String, 1 characters ) 1
     subject (String, 1 characters ) 1
      hostname (String, 9 characters ) 127.0.0.1
      created (String, 10 characters ) 1410041425
   changed (String, 10 characters ) 1410041423
    status (String, 1 characters ) 1
    thread (String, 3 characters ) 01/
    name (String, 6 characters ) gbi222
    mail (String, 0 characters )
    homepage (String, 0 characters )
    language (String, 3 characters ) und
    **paragraph_id (String, 1 characters ) 1**

So for each paragraph , I need to check the paragraph_id and if the number of the paragraph number is equal to the paragraph_id, show that comment under that paragraph.

so after print render($paragraphs[$i]); in my code, write:

       if($i==($content['comments']['comments']['22']['#comments']->paragraph_id))
           show the comments that its cid is 22.

So now my questions are:

1) How can I say that if the above equality is true, show the comment subeject, author, body, ... for that comment?Because if I write:

$content['comments']['comments']

it will show all the comments.

2) In this example I knew the cid number of that comment, which was 22, so what can I write instead of '22', in
         if($i==($content['comments']['comments']['22']['#comments']->paragraph_id))

so it means like  any number, so it will do that comparison for all the comments(with their cid number)?


texts: Not able to see < character in front end

texts:
I am running into a problem when creating content with the < character… It is quite strange as the symbol is showed in the backend, when creating the content, but it disappear when you go to /node/%nid. Actually the whole  text nodes, where the symbol is, disappears. I have disabled all the filters and the problem remains…

By the way, I have a Drupal 7 installation and cKeditor module installed, but switching to plain text editor doesn't make a difference.

Does someone has a clue of why this is happening?

Thanks in advance.

EDIT

After some tests, I have discovered where the problem comes from. It has to do with the "word link" module. When word link is configured to run on a field, then it seems to remove all the text within the scope of the tags where the < appears. Now it seems it's time to surf the word link code...


texts:
With the help of the support team of my dedicated server, I have setup Drush globally on my server. Now I can run multiple Drush versions like drush6 status, drush7 status, drush8 status with a little tweak in my .bashrc file

One problem I am unable to resolve is that when I download or update drupal it starts giving 500 Internal server error.

My Support Team Told me

When you use Drush to download Drupal, it gives files 664 permission. The PHP handler in the server is suPHP, which requires 644 file permission, so you need to run the file permission fixing script for the account after using Drush install/update commands.

Is there any way we can instruct Drush to download the files with 644 permission?


texts: Upgrade drupal using drush: Failed to check available update

texts:
I am trying to upgrade Drupal from 7.14 to 7.18 using drush up command.

Nothing gets updated and I see a bunch of failed warnings:

Failed to check available update data for CCK.
Failed to check available update data for CKEditor.
...
Failed to get available update data for 51 projects.

I can however download modules using drush dl module_name
All commands are run as root.


texts: Security updates for End of life d8 version

texts:
I have been tasked with updating a site that was at 8.2.7 to 8.2.8 to fix the security item listed at: https://www.drupal.org/forum/newsletters/security-advisories-for-drupal-core/2017-04-19/drupal-core-critical-access-bypass and the apply critical updates.

I had to do this core update manually because the composer update drupal/core --with-dependencies call didn't actually do anything.

I can't update straight to 8.3/4/5 due to a host of custom coded modules which target 3rd party APIs and have dependencies on contributed modules.

I am going to have to update Drupal core incrementally and apply critical updates for the given version and check nothing is broken.

So my question is this:

I have just updated manually from 8.2.7 to 8.2.8. I inherited the site and there is no documentation of what critical updates have been applied to Drupal in the past.

Is there any way I can get a list of the Security updates I need to apply for a given Drupal version (Does a drush or Drupal console command exist that would check the current installation and list .updates required?) and if not how would I go about determining what needs applying ?


texts:
When trying to change the Panel content design, there are no controls displayed as shown:

This is happening only when using Charts in my Panel page. I got this error chrome inspector console:

Uncaught SyntaxError: Unexpected token , in JSON at position 6
    at JSON.parse (<anonymous>)
    at Function.parseJSON (jquery.js?v=1.4.4:32)
    at HTMLDivElement.<anonymous> (charts_highcharts.js?v=1.0:11)
    at Function.each (jquery.js?v=1.4.4:34)
    at $.fn.init.each (jquery.js?v=1.4.4:27)
    at $.fn.init.$.fn.once (jquery.once.js?v=1.2:55)
    at Object.Drupal.behaviors.chartsHighcharts.attach (charts_highcharts.js?v=1.0:9)
    at Object.<anonymous> (drupal.js?pj2bso:112)
    at Function.each (jquery.js?v=1.4.4:33)
    at Object.Drupal.attachBehaviors (drupal.js?pj2bso:110)
parseJSON @ jquery.js?v=1.4.4:32
(anonymous) @ charts_highcharts.js?v=1.0:11
each @ jquery.js?v=1.4.4:34
each @ jquery.js?v=1.4.4:27
$.fn.once @ jquery.once.js?v=1.2:55
Drupal.behaviors.chartsHighcharts.attach @ charts_highcharts.js?v=1.0:9
(anonymous) @ drupal.js?pj2bso:112
each @ jquery.js?v=1.4.4:33
Drupal.attachBehaviors @ drupal.js?pj2bso:110
(anonymous) @ drupal.js?pj2bso:593
ready @ jquery.js?v=1.4.4:30
u @ jquery.js?v=1.4.4:38


texts: Proper Workbench Access/Moderation/Email + Node permissions for my use case?

texts:
I've been banging my head against the wall all weekend trying to figure this out but just can't seem to get 100% of the way there... I fix one thing, causing another thing to break. Making me question if the Workbench suite (Access/Moderation/Email) is the right tool for the job.

Roles:

Auth User: Able to create new Question nodes
Editor Type A: Able to create + edit Question nodes (tied to Node user permissions) within section Category A (tied to Workbench Access permissions)
Editor Type B: Able to create + edit Question nodes (tied to Node user permissions) within section Category B (tied to Workbench Access permissions)

Content Type:

Question

Category (taxonomy field tied to Question Content Type):

A
B

Workbench Moderation States:

Draft
Needs Review
Published

Ideal State:

Auth Users are able to create a new Question node in Needs Review state; specifying the Category it belongs to
Editor A or Editor B is notified via Workbench Email when a new Question node is created and assigned their particular Section
Original Author is notified when Editor A/B has moved the Question node from Needs Review to Published

Current State:

Auth Users were unable to create new Question nodes until I added the Auth User role to the parent level of the Category taxonomy. Auth Users have permission to create new and view Question nodes, but not edit via Node permissions. Auth Users have a subset of fields attached to the Question content type they are able to create.
Because Auth User role is assigned at the parent level, it adds both Editor A and Editor B roles as editors to all categories within the Taxonomy. This causes both Editor A and Editor B to receive email notifications for all categories.
Emails are only generated when a user with access to all fields creates the new Question type node. When Auth User users create a Question node, no emails are generated.

Questions:

I'm surprised I had to add Auth User role to the parent level Category in order for that role to create new Question content type nodes. I tried practically every combination of user permissions and nothing worked until that (which I don't believe is ideal as it causes Current State #2 to occur). Note: I did use the Workbench Moderation permission checker which stated that the Auth User role should have been a qualified author of new Question content types prior to adding Auth Users to the parent level Category.
What would cause the emails to not be generated when an Auth User creates the new Question type?
Is there another module I should be considering for what I thought to be a relatively straightforward use case?


texts: Why this callback doesn't show all node form?

texts:
This question is related to:
Custom module embedding existing node form

After dealing with returning existing node form via custom module (my_singnup module achieved with the big help of Clive) returning form has no custom field groups and custom fields.

function my_signup($node = FALSE) {
   if($node) {
     if($node->type == 'event') {
       module_load_include('inc', 'node', 'node.pages');
       global $user;
       $new_node = new stdClass;
       $new_node->type = 'signup_node_form';
       $new_node->language = LANGUAGE_NONE;
       $new_node->user = $user->uid;
       $new_node->name = (isset($user->name) ? $user->name : '');
       $form = drupal_get_form('signup_node_form', $new_node);
       return $form;
     }
   }
   return drupal_not_found();
}

signup_node_form was build via field UI (create new content type) and looks great when core node/add/signup. It has vertical tabs, validation etc.

I was expecting to get the same with mentioned code. Unfortunately it's not working. I'm getting just Drupal stuff vertical tab (Menu, Book, Version, Adress, Comments...) without my custom groups and fields.


texts: Search not finding search term from page title

texts:
Using the default database search index in drupal 8, when I search for a term from the a page title, sometimes it shows the result and sometimes it shows nothing, even though i enter the exact page title in the search. All pages have been indexed.

How can I debug why the search term is not being returned?


texts: How to get Drupal 7 installed in a sub-folder / sub-directory properly?

texts: Currently i'm trying to installing a drupal 7 installation in a subfolder of another drupal public_html folder, but it doesnt seem to work. I am getting a redirect loop error in chrome. I already modified the .htaccess in the parent drupal installation to ignore the sub-folder and i also set the $base_url in the sub-directory drupal installation.


texts: Programmatically display user names according to the user profile type

texts:
This is a Drupal 7 site. I have a profile2 module installed with several profile types for different users. The user name should be displayed according to the profile type:

For personal users - the user name should be build from the first and last name fields.
For business users, the user name should be taken from the business name field.

How do I display user names programmatically?


texts:
I am trying to add a location to a node using Drupal services.

This is the JSON sent to the service

{
   "node":{
      "type":"restaurant",
      "title":"Restaurant from JSON API",
      "field_restaurant_location ":{
         "und":{
            "locpick":{
               "user_latitude":"22.38131",
               "user_longitude":"114.168639"
            }
         }
      }
   }
}

I can not get it to save the location to the node. Any ideas ?


texts:
I'm trying to make a ahah form. the problem is the ahah is ignored. when i check the classes on the submit button, it doesn't have the 'ahah-processed' class. The really interesting thing is that ahah is working perfectly on my site, and even on a nearly identical form I created. this is how i'm creating the ahah submit button:

$form['ri_email_submit'] = array(
        '#type' => 'submit',
        '#value' => t('Submit'),
        '#weight' => 1,
        '#submit' => array('ri_email_form_submit'),//none JS version
        '#ahah' => array(
          'event' => 'click',
          'path' => 'ri_email/ajax',
          'wrapper' => 'email-friend-wrap',
          'method' => 'replace',
          'effect' => 'fade',
          'progress' => array(
            'type' => 'bar',
            'message' => t('Loading...')
          )
        )
        );

I checked the menu path, it's correct.

UPDATE: this is the menu callback:

function ri_email_ajax() {
    return drupal_json(array('status' => TRUE, 'data' => '
Your email has been sent.
'));   }

by the way, i discovered that it didn't work when i invoked drupal_get_form() from page.tpl.php, but it does work from node.tpl.php

there is something missing with the javascript that is supposed to handle the ahah


texts: Passing Timestamp in the SQL Query to filter results

texts:
I've a query where I want to filter query results based on today, yesterday and week. I've written queries within Drupal 7 and it is as follows:-

$result = db_query("
    SELECT
  n.title, n.nid,
  COUNT(*) AS times
FROM
  {node_view_count} a, {node} n where a.nid = n.nid AND a.uid = :uid AND n.nid <> 2120 AND DATE(from_unixtime(:mydate)) = CURRENT_DATE
GROUP BY
  n.title
ORDER BY
  times desc",
array(':uid'=>$_GET['uid'], ':mydate'=> date('Y-m-d H:i:s', "a.timestamp") )) -> fetchAll();

My question is, that could I pass two variables in the array as a parameter? Also if I could why is this query not working when I pass two parameters in it. The problem is that I need to convert the timestamp to date before using it and I am using a query Variable in the parameters.

Do you think you could assist in this?

Thanks.


texts:
There's a Drupal6 website I need to work on for a cliente. However, client does not have access to the admin. They don't remember their user/password.

What's the best way for me to retrieve the admin access besides the "remember password" feature?

Thanks a lot!

Johann


texts: How do I can change the default description of elements?

texts:
I'm trying to change the default descriptions in different pages like (add users). I tried devel themer to find out where there descriptions are came from but it showed nothing. for example look at this picture (add user) :

how do I can change the texts displayed by red line?

Update

I tested this code in template.php

function MYTHEME_form_alter(&$form, &$form_state, $form_id){
if($form_id == "user_register_form"){
    $form['account']['name'] = array(
            '#title' => t('New username'),
            '#description' => t('New description'),
    );
    }
}


texts:
We're building a drupal-site with an upload form. Not webform.

When we click on the "insert image" button we get alerted with "Component returned failure code: 0x80460001 (NS_ERROR_CANNOT_CONVERT_DATA) [nsIDOMFormData.append]" from Firefox. Works in Chrome though.

Traced the problem down to being some sort of error from Firefox's engine, HOWEVER, I also noticed this module when searching for the error, in particular #6:
http://drupal.org/node/1386294. It works perfectly when we do it through the controlpanel BUT NOT when we print the form out.

I'm sorry if the question is too specific or is placed in the wrong category.


texts: How to create a shortcut to IMCE File Browser?

texts:
The File Browser link is different for each user, e.g.:

http://example.com/user/1/imce
http://example.com/user/10/imce

How can I create a shortcut to the File Browser which is good for all users?


texts:
I'm new in Drupal 8, and I want to use submenu as a filter in my page.

Example:

  ParentChild

      child0
           .child1
           .child2

When I open the Parent Child page I want that submenu appear as a filter.
like this:  child0  child1 child2
What should I do??


texts: Entity where member variable is different type than when serialized

texts:
Not entirely sure how to phrase this.
I've got a config entity that needs to store a block id. In my config I have the mapping set to a string for the id.
When I load the entity, I'd think it would be more convenient to load the id and have the variable be a block.
This would mean I would need to :

On load, set $this->block = loadblock($id)
On save, set config->block = $block->id()

I'm finding the saving of entities to be quite 'magic' and thus hard for me to figure out.
Schema:
myent.myent.*:
  type: config_entity
  mapping:
    display_block:
      type: string
      label: Display block

entity:
/**
 * @ConfigEntityType(
 *   id = "myent",
 *   ...
 *   config_export = {
 *     ...
 *     "display_block",
 *   },
 * )
 */
class MyEnt extends ConfigEntityBase {

  // This should be loaded as an entity, not a string.
  protected $display_block;

}

For the loading, I could just override __construct and use the loaded string to load up the entity but that feels very hacky. Plus then IDK how to save it properly when saving.
There is also the option of having a getBlockRaw and getBlock as two seperate options. Have a variable for the string and a non exported one for the loaded entity.


texts: How to adapt the date format in the admin/content page?

texts:
Each Article shows "Authored on YYYY-MM-DD" date per configured regional date format. e.g. 2015-05-14 00:00:00 +0100

However, the content listing at admin/content shows the UPDATED date as MM-DD-YYYY unlike anything else and is confusing to admins.

Users have no choice of Default Time / Region on the Drupal 7.37 site.
Date and Time Long, Medium, Short formats are all ... YYYY-MM-DD


texts: How do I prevent the HTML markup in an item list from being escaped?

texts:
As you can see in the code below, I try various ways to prevent Drupal from escaping the HTML and passing the link tags to the output, including the use of '#allowed_tags' and the Markup class.  None of these approaches are working.

$text = t('Administer books');

$markup = new Markup();
$link = $markup->create(Link::fromTextAndUrl($text, $url)->toString());

$items[] = $link . ': ' . t('Browse books and edit fields') . '.';

$text = t('Import books');
$url = new Url('mei_marc.import');

$items[] = Link::fromTextAndUrl($text, $url)->toString() . ': ' . t('Visit this page to import a book') . '.';

$array['mei_marc_list'] = array(
  '#theme' => 'item_list',
  '#list_type' => 'ul',
  '#title' => '',
  '#items' => $items,
  '#allowed_tags' => ['a'],
);

$txt = drupal_render($array);

$markup = new Markup();

$list = $markup->create($txt);

return ['#markup' => $list];

The output is the following.

&lt;a href=&quot;/mei_marc/list&quot;&gt;Administer books&lt;/a&gt;: Browse books and edit fields.

&lt;a href=&quot;/admin/mei_library/import&quot;&gt;Import books&lt;/a&gt;: Visit this page to import a book.


texts:
I mean can we have something like this? url with double ? in drupal?

http://drupal.org/?destination=xxx/yyy?token=zzz


texts: Features versus Configuration Management

texts:
I am building a Drupal 8 site and I have done some research whenever I should use Configuration Management or Features to export configuration and include it in my profile.
In order to export and import configuration with Configuration Management from one site to another, sites have to have the same UUID. It means that they have to be a clone of each other.
There are two ways to achieve this:

Clone the DB from one site to the other in order to have the same UUID
Programmatically modify the UUID to match the one in configuration

The site I am going to build will have its own profile installation and my intention is to keep configuration or features within the profile.
I have already created my profile installation but now I have to include configuration in a way it does not depend on UUID so I can:

Spin up a fresh development environment using profile installation
Develop new functionalities
Export new functionalities in the profile
Deploy it to prod and apply new functionalities without re-installing the site

How can I export configuration and add it to my profile?
Should I use Configuration Management and manually remove the UUID or should I use Features and add it to my profile?

Using the Features module, I am not able to set the destination for my features. I would like to put all my features under profiles/my_profile/feature. When I create it I am not able to set a destination so it gets saved under modules/custom. I manually moved it from modules/custom to profile/my_profile/features. If I update it, it will not update the features I moved but instead it will create a new feature with the same name under modules/custom. How can I setup a custom destination?


texts:
In Drupal 7 we used to use hook_schema() in the .install file to create a table. I believe that, in Drupal 8, you can do that as well, but I was under the impression that you should create .yml files with your schema.

What's the method for creating tables in Drupal 8?


texts: Is there a way to dynamically resize remote images in drupal 7?

texts: Part of the site, I'm making has a YouTube video gallery. I want to display the thumbnails in list format but I need to resize them first. Using theme('image_style', etc) would be the simplest solution but it seems to only work on local files. Is there a way to get this to work with remote files?


texts: Moving / Migrating image files from another site into an existing Drupal 7 site

texts:
I'm currently doing a data migration from one Drupal 7 site to another Drupal 7 site. So far I exported the data from the old site into a CSV file and then have it get imported into the new site by looping through each row of each result and doing a $node object and then node_save.

The problem now is how do import/copy the images over? I have the url path from the old site.Do I use file_unmanaged_copy() function to get them into the system? But from the docs, it says I can only use public:// and I'm not sure if http urls to the images would work. Or is there another function I need to use for this purpose?


texts:
suppose this form:

function test_ajax_form($form, &$form_state){
  $form['school'] = array(
    '#type'             => 'textfield',
    '#title'            => t('School'),
    '#required'         => True,
    '#ajax' => array(
      'callback' => 'get_formations',
      'wrapper' => 'formationsWrapper',
    ),
  );

  $form['formations'] = array(
    '#type'             => 'select',
    '#title'            => t('Formations'),
    '#required'         => True,
    '#options'           => array(),
    '#prefix'           => '
',
    '#suffix'           => '
',
    //'#access'           => empty($form['values']['formations']['#options']) ? False : True,   );

  return $form;
}

and the callback:

function get_formations($form, &$form_state) {
  $formations = array(
    0 => t('No'),
    1 => t('Yes'),
  );

  $form['formations']['#options'] = $formations;
  return $form['formations'];
}

Everthing works fine, my callback is called and the values populate the select. If I change the school value, then the callback is recalled and I have an error:

  An illegal choice has been detected. Please contact the site
  administrator.

I think it's beacause I try to re-populate the options but I don't know how to fixe.

Any idea ?


texts: How to easily find whether the contibuted modules have been updated or not?

texts:
I am trying to upgrade my project form D6 to D7. I have used several contributed modules in my porject.

I am aware that I should check availability of all the contributed modules in version 7 before starting upgrade process.

In this case I need to check every independent contributed modules seperately whether it is available or not..

My question is:

  Is there any other easy way to check availability of all the
  contributed modules via programatically or any other modules to do
  this...

BTW : Not using drush...


texts: Drupal 7 add calendar module. Doubleclick on a day to add calender item for that day

texts:
Adding 50+ calender items to my drupal Calendar is a pain and takes a lot of time clicking and selecting the right date.
What would be awesome is that it would be possible to just doubleclick or click on a + or something on the day that needs a new calender item.
Does anyone have a clue on how to do this?
Or something similar.
I already added the link to add a calendar item above the calendar to add a calendar item from that view but then I still need to change the date unless it is the current day.

Thanks in Advance!


texts: Token Not Working On Auto Node Title and Auto Entity Title

texts:
I am using drupal 7, auto node title 7.x-1.0, and token 7.x-1.4. I am trying to hide content type title field and set title value based on other field value, so i use auto-node title and token module. But, when i try to set the default value of the title using token, the token didn't work.

Then, after searching for a while, i've found this post:
Token replacement pattern is not working

So, i try to install auto entity title 7.x-1.1 module and disable my auto node title. But, the token still not working. Anyone could help me?

Thanks in advance.


texts: Admin menu for client, each menu for each content type

texts:
I want to create a admin interface for my client. For now, if my client wants to add an article, he needs to click Content, Add content, and select Article as content type; at the end, he can create a new node. This is not user-friendly.

I want to have Article, Photo, and Video as menu link in the Admin menu. If the user clicks on Article, it will show the list of all the articles list; I don't need to use the "type filter" to filter the content type, as users will click on the Add link in this list view directly, to add a node of each content type.

How can I achieve this?


texts: I am working on building a new site in Drupal 7 and would like to have accessibility options.  I'm using the Page Style and Text Size modules, which provide blocks that contain the accessibility options.  However, instead of placing these blocks directly on the site I would like to have them contained in a drop-down similar to the Perkins.org website.


texts: How to import external database table into Drupal database table?

texts:
I imported an external database into my local Drupal database. The database table I am particularly interested in is the default "users" table in Drupal and the imported "USER" table from the imported database (My current Drupal database has both "users" and "USER" tables).

The external "USER" table contains columns that are not contained in my current Drupal "users" table.

I would like to perform either one of the following:

Merge the "users" and the "USER" table, so that all the rows from the "USER" table is now contained in the "users" table.
Allow Drupal to obtain login information from the externally imported "USER" table. By this, I mean if there is a user called "ABC" in the "USER" table, then Drupal should allow user ABC to log into the website.

Any help is appreciated. Thank you.

EDIT:

I have tried using the migrate module, but nothing shows up nor do any options show up for me to migrate my data. I have found a little tutorial that teaches how to import external data using drush and migrate - http://www.gizra.com/content/data-migration-part-1. Is this the correct way to use Migrate?


texts: How to log to console when in a Drupal attach behavior?

texts:
I'm using Drupal 7. I have the following code that tries to log to the console:

function mymodule_get_jquery() {
  $jquery = <<<JAVASCRIPT

  console.log("here");

  (function($) {
    console.log("there");

    Drupal.behaviors.addHighStockChart = {

      attach: function(context, settings) {

        console.log("everywhere");

        /* ... */

      } // end attach
    } // end Drupal.behaviors.addHighStockChart
  }) (jQuery);

JAVASCRIPT;

  return $jquery;
}

If I open the Console in Firefox or Chrome, the log outputs the following:

JQMIGRATE: Migrate is installed, version 1.4.1
here
there

Why isn't the "everywhere" line getting logged? Is there any way to log JavaScript info in the Drupal behavior attach function?

UPDATE:

Here is how I am calling the mymodule_get_jquery() function:

/*
 * Implements hook_page().
 */
function mymodule_page() {

  /* ... */

  $jquery = mymodule_get_jquery();
  drupal_add_js($jquery, "inline");

  /* ... */
}


texts: How to add an HTML comment to the head of every page?

texts:
I'm looking to add a copyright message to every page of my website using Drupal 7. The easiest way to do this would be to add it into the header, since that appears everywhere. I know that changes can be made to html.tpl.php.

But I'm unfamiliar (for now) with php, and need to know if I need to add any special commands to the php or can I just inject my comment into the file?


texts:
After downloading fresh files and restoring fresh database from prod website, on my local server (IIS) I have a problem.

Fatal error: Call to undefined function wincache_ucache_get() in E:\XXX\sites\all\modules\wincachedrupal\drupal_win_cache.inc on line 145`

Permissions are good (for IUSR and IIS_IUSR)

settings.php passwords are OK

I updated the wincachedrupal module to newest version

I cannot do anything with Drush (same error as above)

I cannot rebuild the registry

if I delete or change the name of the wincachedrupal module, I get this error:

Fatal error: require_once(): Failed opening required 'E:\XXX/sites/all/modules/wincachedrupal/drupal_win_cache.inc' (include_path='C:\xampp\php\PEAR') in E:\terma\includes\bootstrap.inc on line 2413`

Have you any idea on what can be wrong?


texts: How to allow multiple parents (menu items) for a single node

texts:
How can I enable a single node to have multiple parents (D7)?

Is it possible to show the hierarchical structure in the menu, therefore breadcrumb?

Can I set a structure like the following?

Home > Section 1 > SubSection A > 'my node'
Home > Section 2 > SubSection B > 'my node'
Home > Section 2 > SubSection B > 'my node'

Before you ask/suggest:

I used nodehierarchy on a previous project, and the subfeature 'Allow multiple parents" seems a little buggy at the moment
Duplicate content is not a problem here, since it's an intranet

Do you have any suggestion?


texts: How to convert text area data into select list in forms?

texts:
I want to create a configurable select list in forms.To achieve this what I did is I have created a text area, in that I will enter values like:

HI|Hi
BYE|Bye

So, in form select options I have to use these values in a dropdown list. How can I achieve that. I am getting this text area data in form like below.Here I am getting data, but not displaying in the options.

$entityoptions = variable_get('entitydropdown');

I am getting the values as it is, but am not getting how can I assign these  values to #options. I did like below but its not displaying the values.

'#options' => $entityoptions,

Please help me to identify, where I am doing wrong. Thanks in advance.


texts: Does removing fields also removes submitted values?

texts:
I just removed each fields of a form in order to update them. Sadly, I'm afraid it also removes all the associated values submitted, because when I navigate to the 'Result' tab, values are missing.
Is there any way to recover this?
How could I fetch the whole submissions despite the fact that some fields does not exists anymore?
EDIT: I've root access to the MySQL database (currently searching inside it)
Some unsuccessful attempts:
-- Enable to fetch submitted data associated to a submission identified by its node id

SELECT * FROM webform_submissions
JOIN webform_submissions.nid = webform_submitted_data.nid
WHERE webform_submissions.nid = 42;

> Empty set (0.00 sec)

-- Verify that node id actually exists: it does

SELECT * FROM webform_submissions WHERE nid = 42 LIMIT 1;

> +------+--------+-------+----------+------------+---------------+
> | sid  | nid    | uid   | is_draft | submitted  | remote_addr   |
> +------+--------+-------+----------+------------+---------------+
> | 2538 | 42     | 26261 |        0 | 1613557280 | IP.ADD.RE.SS  |
> +------+--------+-------+----------+------------+---------------+

-- Verify that some submitted data related to this node id are present

SELECT * FROM webform_submitted_data
WHERE nid = 42;

> Empty set (0.00 sec)
-- Has it been deleted ?

Assumption: it has been deleted and I'm in a bad trouble !


texts: How to add a content navigation menu based on taxonomy or parent relation?

texts:
We are new to Group module and we can't figure out how to create a content navigation menu/tree we want to place to the left of the group page. We are evaluating generating this menu by taxonomy or parent relation.
We have seen the module Entity Reference Hierarchy https://www.drupal.org/project/entity_hierarchy could be a good fit.
Any one has done this before/has any ideas how to build this menu/tree?


texts: Drupal 8 devel dpm does not expand Drupal\node\Entity\Node

texts:
I'm getting a feeling that Devel got pretty much useless with D8. When I try to dump most of the drupal objects I get only (Object) Namespace\Class output. No fields data is printed. print_r is able to print a lot of information but it's close to useless because it's output is virtually unreadable.

Is there a way to nicely print (dpm?) contents of objects in D8?


texts: How to solve these errors after running update.php?

texts:
I´ve updated my D6 site to Drupal 7.
Even after running several times the update.php script, there are two errors still out there:

The following updates returned messages:

system module

Update #7061

  Failed: DatabaseSchemaObjectExistsException: Table system_update_7061 already exists. in DatabaseSchema->createTable() (line 657 of /home/liga/public_html/includes/database/schema.inc).

votingapi module

Update #7201

  Failed: DatabaseSchemaObjectDoesNotExistException: Cannot change the definition of field votingapi_vote.content_type: field doesn't exist. in DatabaseSchema_mysql->changeField() (line 454 of /home/liga/public_html/includes/database/mysql/schema.inc).

Note: I have Voting API module installed in D6, but I haven´t upgraded it yet.

This is what I´ve done:
I´ve deactivated the module in D6, I´ve upgraded everything, and I haven´t updated the module nor try to use it, yet. Maybe the second error will go away when I do upgrade Voting Api to d7. but how about the first error?

Any thoughts will be greatly appreciated. Thanks!

UPDATE: I´ve updated my site to the latest D7 version (7.22 - 2013-Apr-03), and Votingapi module to it´s latest stable version (7.x-2.11 - 2013-Mar-22), and the issues remain exactly the same.


texts: Where does Commerce Stripe store the plans that are created on my stripe account?

texts:
I have a stripe account all setup and I have created plans. In Drupal Commerce I have created products, but I realised it should have pulled the "plans" down from stripe. I have also tried the stripe payment module which did pull the plans down, but it would have required a lot of customisation to work well with the roles that we needed to assign per plan.

Where does Commerce Stripe store the plans created on my stripe account?


texts:
I converted a Drupal 7.xx site to Drupal 8.x manually. Updated it to 8.4.5 and tried to use composer to update it to 8.5.6 (Latest stable release). I have the original site as the public_html/drupal site and the 8.4.5 site is at public_html/drupal8/drupal-8.4.5. Composer, then drush seemed to work, but when I take the site out of maintenance mode, log in as admin, "Reports" still say it is at 8.4.5. Commands: composer update --with-dependencies and drush updatedb (I actually use vendor/drush/drush/drush updatedb) drush cr drush sset system.maintenance_mode 0 drush cr

I searched the docs,  found a few suggestions elsewhere, but can't fix this.  The bot on StackOverflow, where I have not gotten any response, suggested I post it here.


texts: How to check the remaining capacity for an event when using the Registration module?

texts:
I am trying to create a Rule (using the Rules module) that fires off an email when the capacity of registrations for an event get full. We have set this up using the Registration module.

I set this rule up like so:

Event = Upon new registration.
Condition: Data comparison - registration:count.
Action = email author.

In the manage registrations tab the registration-count is always 1 for each user. So I wonder how I can check the capacity for the event to trigger the email.

I have tried to search for information and try many scenarios, however not finding one that works.

I would like some idea(s) or path to a solution I am not thinking of.


texts: How to link Views Bulk Operations and Bibliography modules in a home-made search engine?

texts:
I am using Bilbiography module to manage scientific publications on a website.
The default search engine is nice but I would like to add a Views Bulk Operations function so users can choose specific nodes (tick the boxes on each line) and then export them to End Note or Bibtex, etc., like Bibliography does (export links at the top right).
Has anyone built a thing like this before in a View?
I would appreciate to have a few tips on this.
Thanks in advance.


texts:
I'm rebuilding a Drupal 6 site in Drupal 7.  So much needs to change, it doesn't seem worth trying to upgrade, so I'm starting from scratch.

I would love to know if there is an easy way to export all of my content.  I have about 1000 nodes of two different custom content types.  Is there a module to do this?  If not, I guess I just have to sit down and figure out how data is stored in the database in both versions?

Thanks


texts: Is it possible to use stringoverride on ONLY one page?

texts: I want to modify ubercarts "Add to cart" text button but only on ONE page that I've customized. I haven't been able to figure out how to call the button via php so I don't know if that's possible. I figured I could use string override but that would change the text across all pages and for that I can just change the option in ubercart.


texts: DatabaseSchemaObjectExistsException + PDOException: Can't update!

texts:
I´ve read many posts about this problem, and tried many things, before deciding to open this one. This is the issue:

1. I upgrade my D6 site and all it´s contrib modules to latest D6 versions.

2. I disable all contrib modules.

3. I try to upgrade to D7, the same way I usually upgrade (deleting old core files and adding the new ones).

4. After upgrading everything, and run the update.php script, I encounter that all my admin pages show a message “You do not have any administrative items”. I´ve read several posts about this error, and decide to run the update script again, because it probably didn´t finished.

5. That was true, I´ve had 14 updates pending. So after running the script again, this error appears:

  Update #7061: Failed: DatabaseSchemaObjectExistsException: Table system_update_7061 already exists. in
  DatabaseSchema->createTable() (line 657 of
  /home/public_html/includes/database/schema.inc). So after reading that
  this is some sort of a Drupal unresolved bug, I delete that table
  (system_update_7061), so it can create it again.

6. I run the update script again and found a new error:

  System Update #7061: Failed: PDOException: SQLSTATE[23000]: Integrity
  constraint violation: 1062 Duplicate entry 'public://proyecto.zip' for
  key 2: INSERT INTO {file_managed} (fid, uid, filename, uri, filemime,
  filesize, status, timestamp) VALUES (:db_insert_placeholder_0,
  :db_insert_placeholder_1, :db_insert_placeholder_2,
  :db_insert_placeholder_3, :db_insert_placeholder_4,
  :db_insert_placeholder_5, :db_insert_placeholder_6,
  :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => 1889
  [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] =>
  proyecto.zip [:db_insert_placeholder_3] => public://proyecto.zip
  [:db_insert_placeholder_4] => application/zip
  [:db_insert_placeholder_5] => 22989 [:db_insert_placeholder_6] => 1
  [:db_insert_placeholder_7] => 0 ) in system_update_7061() (line 2816
  of/home/public_html/modules/system/system.install).

So, I´ve read in a post that this error could happen because of a problem with files that have caps letters, and that they can be considered duplicate, etc.
So, after trying a lot (I´ve changed the filename, the uri, the fid and the uid associated to that file), I decided to delete that entry.

7. I run again the update script (after deleting the system_update_7061 table, because it was recreated when I tried to upgrade the second time), and found the the same error appeared again. So, the entry was there again! It was re created but I´m in square one again, because the error persists, and each time I try to delete the entry, it is recreated by the script, before it can finish.
I must add that, yes, the /admin pages do still tell me the nasty message “You do not have any administrative items”.

8. Please note that I´ve followed the instructions here (Drupal 7 and the "You do not have any administrative items" error), and while I can access the menu links from admin/structure/menu/manage/management, I still get the error message under admin/ link. I´ve cleared the cache and nothing happened.
And I´ve checked the admin/modules link and ALL contributed modules are "incompatible" with Drupal 7, when I upgraded them!!

What can I do??
Please help, any insight will be very much apperciated!!