texts: Detect when a new image is uploaded to my server

texts:
I have created a custom app that will allow logged in users to upload an image which will be automatically uploaded to my web server through SFTP method.

Is there a module or even programmatically possible to detect from my Drupal 8 site that there is new image uploaded to the directory ../sites/files/app-images/ of my server and retrieve the name of that image ?


texts: apply css for particular node and do not apply for particular node

texts: I used the CSS injector module to replace the default CSS. I applied that CSS for  paths like node/*. How do I exclude node/add from that CSS (the one I created with the CSS injection module)?


texts: How can i add text custom field on product detail page?

texts:
I want to add custom text field on product details page Where user enter some text . Which text will be shown on cart and checkout page. I have added the text field on product but it is not saving .Please guide me what things i am missing?

 function my_module_form_alter(&$form, &$form_state, $form_id)
  {
   if($form_id == 'uc_product_add_to_cart_form_2')
    {

     $form['additional_guests'] = array(
      '#type' => 'textfield',
      '#title' => t("Additional Guest Names"),
    );

}
}

How can i save this custom field and getting on cart/checkout page?


texts: How to translate a block automatically created with a view?

texts:
Displaying only the block translated into Italian language change when I see the same block in Italian.
I send you a picture of my view...


texts:
I am using Drupal Commerce and Views to make a products page that has a number of elements on it that are somewhat complex.

So far my page is a simple view that lists products as a table that also has some filters that users can modify to sort through products. However I am having trouble adding fields to that view to add the other elements i want to display.

What i need:

I need to add a "Add to cart" button for each product displayed.
I also need to add a product image that changes to the smaller displayed images when clicked.
In addition I also want to add a number of custom text fields that do not change when the user is applying the filters to the page.

What I have done so far:

I have attempted to use Views Field View and create sub views and add them to a parent view, however I am having trouble getting the sub views to show up.
Found a couple of sites that show methods of adding "Add to Cart" buttons manually by editing the files. But i wanted to make sure there was not module for it already.

If anyone can point me in the right direction i would appreciate it.


texts:
I have responsibility for a number of Drupal 6 and Drupal 7 sites and I'm curious about a difference I've noted among them.

URL aliasing is enabled on all of the sites, so that a user who navigates to 'some/readable/path' is directed to 'node/123' but continues to see the 'some/readable/path' URL alias in the browser's address bar.

On most of the sites, if the user requests 'node/123', that URL is displayed in the browser's address bar. On a few of the sites, however, the user who enters 'node/123' sees 'some/readable/path' in the address bar.

I was not aware that this sort of "bidirectional aliasing" was possible; it doesn't seem to be default behavior. Is there a module which provides this bidirectional capability? If it is default behavior, how is it enabled?


texts: How do I programatically add address to commerce order

texts:
I've a subscribe form on my website which i've got working(ish). So far i've got it asking user to input name, address, email, password and the subscription level + starter kit (from a list of promoted commerce items).

Once a user hits 'subscribe' the module creates a blocked user account (it will be activated by Paypal IPN listener if they pay), adds the commerce order (at checkout stage, thanks to Ryan for the script!) and then redirects to paypal for appropriate payment.

Up to this point i'm happy with everything except that the recorded order doesn't contain the address the user entered on the subscribe form and I can't figure out how do do this.

Has anybody managed it before,  just point me in the direction of the function and i'll go from there.

Thanks


texts: Allow users to manage their own mailing list?

texts:
I would like to allow each user to manage its own mailing list (import a csv list, add/remove emails).
My goal is to allow users to send an email notification to this list when they create a certain content type.

Modules like simplenews, Views_Send, or mailing_list don't seem to match my needs as they only allow to create "globals" newsletters associated with a subscription  system, not real email list "crud" by user.

Maybe should I use a generic csv data importer, views/bulk and rules to achieve this?


texts: How to add Follow Me link inside content type in Drupal 7

texts:
My project contains two content types:- Professor and Lecturer.
Here the users are student so students can log in using their own credentials.

Now I want to show up a button/link with Text "Follow Me" in Professor & Lecturer Content Type.When User/student will select the link/button then the corresponding Lecturer/Professor will be attached to the student profile and will be visible inside their home page. Similarly that student will be visible in Teacher/Lecturer.

I look at The "Relation" Module in Drupal 7 but my use case don't need to display too many things in the widget. There should be a simple button/link which relate user and content type.


texts: Installing Profile2 on Commerce Kickstart

texts:
When installing the module: "Profile2" to distribution of Drupal 7: "Commerce Kickstart".
and, I do activate, but got the following error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache Server at mydomain.com Port 80

And since then, every page or link that I want to enter it shows me the same error message.
I deleted the file. Htaccess (I think it has to do something this file) but still the same error persists.

Please someone can provide some possible solution?

Best Regards


texts: using hook_form_alter on a same form from 2 different modules

texts:
How will a predefined form behave if we have two different forms that implement hook_form_alter?

I would explain my question by an example, because currently I got a crash on it:

I have a predefined user_login form in user.module

I created two new blocks called author_login and creator_login. Each of these module using the form user_login and adding new validating properties for each form by using function hook_form_alter().

The new validating properties are:

For author_login block: if user doesn't have author role, user will not be logged into system, error: "you don't have author role"
For creator_login block: if user doesn't have creator role, user will not be logged into system, error: "you don't have creator role"

But the problem is: the new login block I created works fine if only one of two modules is enable. If I enable both modules, no user cannot log in to the system through these module.

For example, I have both modules enabled, I go to author_login block and log an user named Mark, who has role Author, to the system, an error message displayed: "the user Mark doesn't have creator role". And similar to creator_login block.

Why does this happen? I thought that the hook_form_alter will alter different properties to each new module we created, make each new form works separately. But from this case I encountered, it seem like the user_login form validate all new properties that I added by using hook_form_alter. And how can I avoid this as I want these two form to work separately?


texts:
I've been struggling with an issue today that I just can't seem to figure out.

I have a  webform that includes a file upload that I want to email upon submission.

The email sends correctly (using MIMEmail modules) but there is no attachment.

The webform is for job application.The user will upload the resume and portfolio. The hr and manager want to get mail along with attachment.How they can always be logged into site that is quite impossible. Now the issue is the who ever logged into the site only can see the attachment when click on the link. How to sent attachment from private folder as attachment not just in link(want proper attachment)

I'm running drupal 8. USed modules are webform, mime mail, mail system and also tried swift mailer.

But in webform module mail settings , there is "Include files as attachments" i checked that option. Still it is not working.


texts:
I have a webform with phone field. I am using this modules:

Webform Bootstrap Layout (webform_bt_layout)
Webform Captcha (webform_captcha)
Webform Country List (webform_country_list)
Webform
Phone Number (webform_phone)
Webform Validation (webform_validation)
CCK Phone Converter (phone_cck_convert)
Phone (phone) Phone Country
Locator (phone_country_locator)
Phone Number (cck_phone)
Webform Phone Number (webform_phone)

When I try submit form appears the next error:

"Fatal error: Call to undefined function valid_phone_number() in /Users/carlosfranco/Sites/as/sites/all/modules/webform_phone/webform_phone.components.inc on line 237"

I go to the file in the line 237 from webform_phone.components.inc and the code is:

function webform_validate_phone($element, $form_state) {
  $value = $element['#value'];
  if (isset( $value ) && $value != '') {
    $ccode = $element['#webform_component']['extra']['country'];
    //run through 'phone' module's validation
    if (!valid_phone_number($ccode, $value)) {
      $country = phone_country_info($ccode);
      form_error($element, t($country['error'], array( '%value' => $value )));
    }
  }
}

Really, I can´t see what is the problem. I am new in php and not found the error

Could anyone help me to resolve this problem please?


texts: Change the default "Create new account" title on the User registration page

texts:
I would like the change the default title (and probably also the meta title) of the User registration page, currently "Create new account".

I tried the Static and Dynamic page title method described here, as well as a couple of other suggestions, but none of them worked...

Anyone?  I added a print screen of the route (registration_link.register), the URL is user/register.


texts:
I have two tables: one that stores field with numeric values and another one that stores field with percentage value.

Is it possible to create view field that would store the multiplication result of these two fields? And is it possible to add such field to the filter criteria?


texts:
I want to get a list of all users that are members of a group.
I can get the members using getMembers():
$members = $group->getMembers();
  foreach ($members as $member) {
    var_dump($member);
  }

But this returns not User objects but GroupMembership objects:
object(Drupal\group\GroupMembership)#2609 (1) {
  ["groupContent":protected]=>
  object(Drupal\group\Entity\GroupContent)#2667 (28) {
    ["values":protected]=>
    array(12) {
      ["id"]=>
      array(1) {
        ["x-default"]=>
        string(1) "1"
      }
      ["type"]=>

So how do I get the User IDs from the GroupMembership objects? Or is there an easier way?


texts: Hiding the site domain name from the content writers

texts:
I'm in dilemma. I'm hiring content writers etc for my new sites who risk getting fired from me for not meeting my expectations. I want to keep my site names confidential from the world because of competition and other concerns.

What is the best way to hide the domain name also allowing them to add the content(articles, forum posts etc) straight-forwardly at my production site ?

I was thinking to symbolic link( on my Centos hosting) another idle domain name to point to my site. I'd use relative urls in my site content so Pathauto would take of this. So the content writers would see this idle domain when working on my site.

A site can be visible from multiple domains. For example I can install the same site on my localhost PC. Secondly there are more than 50 million sites. For new sites it'd take a couple of months for a site to start appearing in the top 100 results in Google. How'd a naive person find the site in short time? Hiding the domain name means suppose I've a site name myjobs.com I want to make it visible in somejunk.com domain too and editors will add content in this site.


texts: With a 'review' node type and a node reference to a 'product ' node type limit number of user reviews to one

texts:
In a product node type with a review node type that has a reference field to it, how do I only permit one review per user per product node? Do I use the Rules module and if so how do I configure the rule? Do I make a custom query and then unset the Add Review button/link on the product node in a custom module or in template.php?

(edit) Take the example of product reviews on Amazon or muffler repair reviews on Yelp. The user who makes the review  gets one review per listing or item. After they create the review, they can edit it but can't make another one for that listing or item. Seems logical. Likewise the Fivestar rating widget only allows one vote per item so having several reviews for an item will not permit more than just one Fivestar rating.........

Unless somebody has a better solution, I'm going to test -- since the Fivestar widget makes the database query anyway -- if it has been set by the user on the node view. If true then I will disable the Node Reference URL widget button in the links area. If I need more security, I will create code or a Rue that tests on the Node Add page if the Fivestar widget has already been set to disable the Node Add page and redirect the user back to the product.


texts:
I am working on a Drupal 6 site and have very limited knowledge of writing sql queries.

I have a content type manage_current_university (which is a content profile) and in that use a taxonomy cck field field_host_university. I am generating a table of users who have signed for a content.

If I write this query in phpMyAdmin, I get the correct tid for that user

SELECT field_host_university_value FROM node n INNER JOIN  content_type_manage_current_university mcu ON n.nid = mcu.nid WHERE n.uid =120;

Replicating the same query inside a module:

$currentuniversity_query = db_query("SELECT field_host_university_value FROM node n INNER JOIN content_type_manage_current_university mcu ON n.nid = mcu.nid
                        WHERE n.uid =".$uid."");
while($currentuniversity_result = db_fetch_object($currentuniversity_query)){
            $currentuniversity = $currentuniversity_result->value;
print $currentuniversity; }

Where $uid fetches $user->uid of signed up users.

But the table column is blank for this one. Using similar query to fetch other profile values of the signed up user works.

Please help!


texts:
I have a site setup where users create a node as soon as they login from the activation link sent via email. I've recently been getting tons of people signing up but not creating any nodes because the emails they register with are obviously fake so I would like to remove all the users with the role listing user that hasn't created a node withing a day of registration.

I need help doing this with Rules if at all possible please. If you have any other methods that doesn't involve complex php that would help as well.

Thanks


texts: Migrating user profile picture from D6 to D7

texts:
I'm migrating a site from D6 to D7 and I want to do the User migration in code. The basic profile works fine except for the user picture. I read that it's best to write a separate class for this file so I did. Unfortunately I'm getting nowhere with it.
Can you see anything wrong with this code? I plan to use this class as a dependency in the user profile migration class where I should be able to attach the image based on file id generated in this class.

class MigrateDAFiles extends Migration {
    public function __construct(array $arguments) {
        $this->arguments = $arguments;
        parent::__construct($this->arguments);
        $this->description = t('Profile images');
        $this->map = new MigrateSQLMap($this->machineName,
            array(
                'picture' => array(
                    'type' => 'varchar',
                    'length' => 255,
                    'not null' => TRUE,
                ),
            ),
            MigrateDestinationFile::getKeySchema()
        );
        $this->destination = new MigrateDestinationFile();
        $query = db_select('users', 'u')
            ->fields('u', array('picture'))
            ->isNotNull('picture');
        $query->distinct();
        $this->source = new MigrateSourceSQL($query);

        $this->addFieldMapping('value', 'picture');
        $this->addFieldMapping('source_dir')->defaultValue('http://www.example.com/sites/default/files/artist-pictures/');
        $this->addFieldMapping('file_replace')->defaultValue(FILE_EXISTS_REPLACE);
        $this->addFieldMapping('status')->defaultValue(1);

        $this->removeFieldMapping('path');
}


texts:
I have a site with two languages (Dutch and English).
However if I want to translate a Dutch node I must use the Dutch admin interface, and if I want to edit an English node I must use the English admin interface.

So let's say node/1 is in Dutch and node/2 is English, and my default language is Dutch.
Now, if I go to /node/2/edit, so the edit form of the Enlish node in the Dutch language it redirects to /node/1/edit
If I really must edit the English node I must go to /en/node/2/edit

Also the translated nodes are not present:

While I think it should also display which node ID's are the English and Dutch language on here. Like below:

The part in red is here like it should, but not on my production site as you can see in the first picture.

The second thing is that normally you can edit Dutch, Spanish, and English from the English admin pages. On my production site this I cannot do this. There I have to switch to the Spanish admin interface to translate to translate in Spanish, and I need to switch to English to translate to English.

What am I missing here.


texts:
I'm curious about how Drupal 8 handles nodes 404 requests. I think there might be a route of 404 and then an internal check - if node id doesn't exists, it simply calls 404 route path.

If this scenario is right, how can I achieve the same for custom entity?

I have a content entity type, but want a 404 redirection if someone access wrong entity id directly similar to any node page which doesn't exists.


texts: Contribute D8 version of an existing D7 contrib project?

texts:
Can someone describe on how to contribute the D8 version of an existing D7 contrib project? I maintain the D7 project, and further want to add the D8 version of it.

I am struggling with creating 8.x.1.x Dev branch.

Please share any references or steps to follow.

My Project link: Check DNS.

So when I create 8.x.1.x branch, I can see Drupal 7 specific files within that, so I am confused that how should I manage set of files for D8 and D7.


texts: Delete user account after checkout completion

texts:
Im trying to create a rule that deletes an user account after checkout completion for New users, but it is not working. Can anyone please help me to figure out what is wrong? after checkout completion, check if user is not admin or any other role, then delete the account. After anonymous checkout, an user account is created (blocked, registered).

{ "rules_delete_user_account_after_checkout" : {
  "LABEL" : "Delete User Account after Checkout",
  "PLUGIN" : "reaction rule",
  "WEIGHT" : "3",
  "OWNER" : "rules",
  "REQUIRES" : [ "rules", "php", "uc_cart" ],
  "ON" : { "uc_checkout_complete" : [] },
  "IF" : [
    {
      "NOT data_is" : {
        "data" : [ "order:customer:roles" ],
        "value" : { "value" : { "3" : "3" } }
      }
    }
  ],
  "DO" : [
    { "php_eval" : { "code" : "\/\/ Delete the user.\r\nuser_delete(NULL, [order-uid]);" } }
  ]
}}


texts:
I'm working with print and I would to create a tpl for a specific view (for a "page" display).
Is it possible, using the naming convenction?


texts: What's the difference between the two-column layout and two-column bricks layout?

texts:
I enabled the experimental Field Layout core module. There are two different two-column layouts available: one called "two column" and another called "two column bricks."

The dialog provides the diagrams below which don't clue me into their meaning. What is the difference between these layouts?


texts:
I have a content type with a static field that I want to reference a specific TAX term.  When a new node is added, I want the term to default to a specific reference, and I don't want the author to change it.  I was thinking that a STATIC FIELD could work, but not sure how to hard code the term reference.

put another way, I want to Hard code the TAXONOMY term into a field of another node type.

any other ideas on how this would be done or alternatives?


texts: create entity with entity_metadata_wrapper and set Date value

texts:
I want to create a node entity. This node contain a date field.
So, how can I set the date value ? (using entity_metadata_wrapper)

After several google search and code try, I don't find the solution..
My last try :

$date_temp = new DateTime(date('2013-12-01 00:00:00'));
$new_devicew->field_top[0]->field_date->set($date_temp->getTimestamp());

But i get this error :

EntityMetadataWrapperException : Unable to set the data property field_date as the parent data structure is not set. in EntityStructureWrapper->setProperty()


texts:
here the code i'm working

$query = db_select("aa_koleksi", "koleksi");
$query->fields("koleksi", array("id", "judul"));
$result = $query->execute();
$header = array('Kode Buku', 'Judul Buku',);
$rows = array();

while($data = $result->fetchObject()){
$rows[] = array(
  $data->id,
  $data->judul,
);
}

$form['tabled'] = array(
'#type' => 'tableselect',
'#header' => $header,
'#options' => $rows,
'#multiple' => true,
'#empty' => t('No users found'),
);

return $form;

the result is nothing only alert like

  Notice: Undefined index: #attributes in theme_tableselect() (line 3332 of C:\xampp\htdocs\kinta\includes\form.inc).

any suggestion??


texts: entity_metadata_wrapper langcode always prints default language

texts:
I'm using entity_metadata_wrapper with entity translation to print fields in a template, but it always prints the default language when using a langcode in the options.

$wrap = entity_metadata_wrapper('node', $node->nid, array('langcode' => 'zh-hans'));
print $wrap->field_main_subtitle->value(); // Returns English value

Printing out the $wrap array shows the following towards the end which might give some clue (langcode:protected => und):

[propertyInfoAltered:protected] =>
    [langcode:protected] => und
    [propertyInfoDefaults:protected] => Array
        (
            [type] => text
            [getter callback] => entity_property_verbatim_get
            [clear] => Array
                (
                )

        )

    [type:protected] => node
    [data:protected] =>
    [info:protected] => Array
        (
            [langcode] => zh-hans
            [type] => node
            [property defaults] => Array
                (
                )

        )

Any ideas?


texts:
I enabled the module Webform Mysql Views (https://www.drupal.org/project/webform_mysql_views). Enabled the webform for which I want to create the view through here - http://YOURWEBSITE/admin/content/webform/mysql

I am still unsure how can I actually see my view in this case. Where do I find it? I was expecting it under the results section just in case but I am unable to find it.

Thanks.


texts:
I am storing some files in  public folder, programmatically I want to delete those files through the provided path. I tried using below code, but not worked.

function delete_public_files($arg1, $arg2){
  $uri = 'public://';
  $path= file_create_url($uri);
  $fullpath = $path.$arg1.'/'.$arg2;

  //file_unmanaged_delete($fullpath);

  $fid = db_query("SELECT fid FROM {file_managed} WHERE uri = :path", array(':path' => $fullpath))->fetchField();
  if ($fid) {
    $file = file_load($fid);
    file_delete($file);
  }
  else {
    file_unmanaged_delete($fullpath);
  }
}

These files are not recorded in the file_managed table and file_usage table also. So how can I delete these files. If I pass the path to file_delete($fullpath); It will says error that first argument should be object. So how can I achieve all these things. Thanks for any appreciation.


texts: How do I migrate content to a field added with UI to an existing custom content entity?

texts:
In a custom module (assoc), I have a custom Content Entity (Person) with these fields:

$fields['lastname'] = BaseFieldDefinition::create('string')
$fields['firstname'] = BaseFieldDefinition::create('string')
$fields['email'] = BaseFieldDefinition::create('email')
$fields['cellphone'] = BaseFieldDefinition::create('telephone')

I migrated Person content from a Drupal 6 site using Migrate Source CSV, Migrate Plus, Migrate Tools and this migration file:

id: migration_persons
migration_tags: null
migration_group: null
label: 'Person migration from CSV'
source:
  plugin: csv
  path: /Users/efalzon/Sites/JdP8M7b/config/migration_Persons.csv
  delimiter: ';'
  enclosure: '"'
  header_row_count: 1
  keys:
    - id
process:
  id: id
  lastname: lastname
  firstname: firstname
  cellphone: cellphone
  email: mail
  iscontact: iscontact
  isactive: isactive
  member_id: member_id
  user_id: user_id
  owner_id:
    plugin: default_value
    default_value: 1
destination:
  plugin: 'entity:person'
migration_dependencies:
  required: {}
  optional: {}

I added a field to this entity using the UI:

The corresponding config files are field.storage.person.field_sel_initial_credit.yml and field.field.person.person.field_sel_initial_credit.yml
I tried to migrate some content to this field using

id: migration_sel_initial_credit
migration_tags: null
migration_group: null
label: 'Sel initial credit migration from CSV'
source:
  plugin: csv
  path: /Users/efalzon/Sites/JdP8M7b/config/migration_Sel_initial_credit.csv
  delimiter: ';'
  enclosure: '"'
  header_row_count: 1
  keys:
    - uid
process:
  bundle: "person"
  entity_id: uid
  revision_id: uid
  field_sel_initial_credit_value: value
destination:
  plugin: 'entity:field_storage_config'
migration_dependencies:
  required: {}
  optional: {}

and I got this error when executing the migration:

[error]  Attempt to create a field storage without a field name. (/Users/efalzon/Sites/JdP8M7b/web/core/modules/field/src/Entity/FieldStorageConfig.php:252)

What am i missing?


texts:
I got a page where I link to in the menu bar. On this page there is a custom module. On this page there are items from anothor database where the user can click on. When they click on it they go to another page with more information. When they are on the second page there is no active button in the menu bar. On the second page I also have a custom module.

How can u force a button in the menu bar to have the .active class or in another way so that it haves the active lay-out button.

I use Drupal 7.


texts: How may I allow users to embed a view within a CKEditor text field?

texts:
I'm working on a site that includes a number of service pages (think practice areas in a law firm site) and each service has a number of identical content components (call to actions, legal disclaimers, etc) that are not always in the same order.

It would be awesome if there was a way for my content editors to add these components within the body field in any order they see fit. I believe the CKeditor Blocks module could accomplish this for static content, but for dynamic content I don't see a solution.

Sometimes the body looks like this;

{{ Paragraph }}
{{ Related Services }}
{{ Paragraph }}
{{ Call to Action }}
{{ Legal Disclaimer }}

and other times it's formatted like this;

{{ Paragraph }}
{{ Paragraph }}
{{ Call to Action }}
{{ Related Services }}
{{ Legal Disclaimer }}
{{ Paragraph }}

Specifically, the service content type has a 'related services' entity reference field and users need to include links to these nodes within the body of the page. Typically, if I knew these links were always presented at the end of the body, I'd just create a contextual view and present the results on the page (panels).

What are my options here? I've given some thought to using Paragraphs, but that introduces more work than I'm interested in investing at the moment.


texts:
I'm trying to attach inline js inside a form, but it's not working out. Is there anything wrong with below code

$form['#attached']['js'][] = array(
    'data' => 'jQuery(function() { console.log("test"); });',
    'type' => 'inline',
);


texts: How do I make an external URL open on a new tab?

texts:
When I try putting a link like <a href="http://www.example.com/" target="_blank"> on the link path, I get the following error message:

  The path '//www.example.com/" target="_blank">' is either invalid or you do not have access to it.

Is there a way to have the external URL opened in a new tab?


texts: How to get referencing parent entity when adding entities via Inline Entity Form to set automatic titles?

texts:
I have a content type "Parent" and a content type "Child". When adding Parents, the user can add Childs via Inline Entity Form.

Child content types have Automatic Entity Label enabled. In that automatic label creation, I need data from within the Parent node. Obviously, there is no token for that, so I guess I somehow need to alter the form/ form state during the Parent node creation form.

How could I do that? Is there any way I can use the Parent node's data inside the title creation for the childs using IEF?


texts: No administrative CSS for arabic language

texts:
I have a multilingual website with English, French, and Arabic; I updated from Drupal 7.22 to 7.23 and I found that I don't have the CSS for the homepage in Arabic, as the image below.

Why is it happening? How can I fix this?

Notes

I'm aggregating and using Advanced CSS/JS Aggregation advagg.  I'm using Boost module.


texts:
Password reset link is not working in drupal 8.6. The email with the one-time login link is sent just fine, but when the user clicks on the Login button, they get "You are not authorized to access this page" message. Even I tried to open user/reset/{id} with login as admin still same error. When I figuring out the issue I found one line in user.module line no 556
\Drupal::moduleHandler()->invokeAll('user_login', [$account]); is causing the issue. If I remove this line then I can reset my password successfully. whats this line is doing? Does it load all active modules in website? than there must be issue in any module. Could I remove this line? Any alter solution?

I tried by clearing cache,cookie, browser history, session table, also $cookie_domain = $_SERVER['HTTP_HOST']; this line is not in my settings.php


texts:
I'm developing a store on Drupal 8 with Drupal Commerce 2.1. I'm doing it locally using docker4drupal Docker containers.

I just want to be sure that all my Commerce settings including categories, products and variations will be transferred to the external server during deployment.

Do I need special modules or methods for this except copying the files, database etc?


texts: Can I create a node that acts as a pointer to another node of the same type?

texts:
For example:

There are two types, "contest" and "recipe".  A recipe can reference any number of contests, and a contest can be referenced by any number of recipes.  There is a recipe View that lists all the details of each recipe matching the criteria.  I want to filter the recipes listed only to those in the most recent contest.  I can add the contest relationship.  The problem is that I have to choose from one of the existing contests.  Can I create a contest called "mostrecent" that will refer to a different contest depending on which of all contests was created most recently?


texts: missing content within result of hook_views_pre_render

texts:
Am trying to alter fields output programmatically. Most of the posts state that they achieve this by updating content of result array.

But in my case there is no content except entity-id with some views properties!

My goal is to add classes depending on fields values!! Any idea how to do this ?

Here is the output of my hook_views_pre_render implementation:

db_table (String, 10 characters ) views_view
base_table (String, 27 characters ) search_api_index_solr_index
base_field (String, 13 characters ) search_api_id
name (String, 10 characters ) solrsearch
vid (String, 1 characters ) 1
description (String, 0 characters )
tag (String, 7 characters ) default
human_name (String, 11 characters ) Solr Search
core (String, 1 characters ) 7
api_version (NULL)
disabled (NULL)
editing (Boolean) FALSE
args (Array, 0 elements)
use_ajax (Boolean) FALSE

result (Array, 9 elements)
    0 (Object) stdClass
        entity (Integer) 15
        _entity_properties (Array, 3 elements)
            search_api_relevance (Float) 1
            search_api_excerpt (String, 0 characters )
            search_api_id (String, 2 characters ) 15
    1 (Object) stdClass
    2 (Object) stdClass
    3 (Object) stdClass
    4 (Object) stdClass
    5 (Object) stdClass
    6 (Object) stdClass
    7 (Object) stdClass
    8 (Object) stdClass

current_page (NULL)
items_per_page (NULL)

Thanks!! Much appreciated.


texts: D7 - field_update_instance requiring manual refresh after node save to view new values

texts:
I'm using preprocess_entity to alter an image's style display setting based on number of entity references within a paragraphs bundle. The display setting value is correctly altered on node save, but the updated image style won't display without an additional browser refresh.

function THEME_preprocess_entity(&$variables) {
  if ($variables['entity_type'] == 'paragraphs_item') {
    if ($variables['elements']['#bundle'] == 'promotions') {
      $promo = $variables['field_promotions'];
      $promo_count = count($variables['field_promotions']);
      $promo_img_styles = array(
        1 => 'promotion_1x',
        2 => 'promotion_2x',
        3 => 'promotion_3x',
        5 => 'promotion_5x'
      );
      $promo_img_style = str_replace(array_keys($promo_img_styles), $promo_img_styles, $promo_count);
      $promo_fields = field_info_instance('node', 'field_promotion_image', 'promotion');
      $promo_fields['display']['full']['settings']['image_style'] = $promo_img_style;
      field_update_instance($promo_fields);
    }
  }
}

Any ideas why field_instance_update is requiring the additional refresh?


texts: How can I search for a specific user on the People administration page?

texts: I can filter by Role, Permission and status on the people page, is there an easy way to search for one specific user?


texts: Place output of a custom module in a specific region

texts:
I am using the following code in a custom module to get the title of the node form in the node creation form, i.e, if i add a new content of type BLOG then on top of that node_add_blog form i get a heading/title "Create New BLOG". SO for this i got a custom module from this very forum (kudos). Now i want to know how can i place the output in a specific region, say as the right sidebar.

<?php
/**
 * Implements hook_form_BASE_FORM_ID_alter().
 */

function show_title_form_node_form_alter(&$form, &$form_state, $form_id) {
  // For the node add form.
  //<pre
  //<?php /** print_r($form);*/?>
  //</pre>
  //<?php
  if (!$form['nid']['#value']) {
    // Add "new" to the page title.
    $node_types = node_type_get_names();
    var_dump($node_types[$form['#node']->type]);
    drupal_set_title(t('Create new @type', array('@type' => $node_types[$form['#node']->type])));
   echo "Create"." ".$node_types[$form['#node']->type];
   ;
  }

Regards


texts:
Have a field called url_time in the users table.
I have this function in place, though it does not update the table on the else part.

Does this code look correct?

function my_module_form_submit($form,$form_state)
{
global $user;
$account = user_load($user->uid);
$op = $form_state['values']['op'];

if ($op == $form['linkedin']['reset']['#value']) {
    if (db_field_exists('users', 'url_time')) {
        db_update('users')
            ->condition('uid', $account->uid)
            ->expression('url_time', 0)
            ->execute();
    }
}
else {
    $date = time();
    if (db_field_exists('users', 'url_time')) {
        db_update('users')
            ->condition('uid', $account->uid)
            ->expression('url_time', $date)
            ->execute();
    }
}
}

This is the linkedin function that I am trying to implement, so when the user authorities, the "else" will write a date.

function linkedin_user_enable_form($form, $form_state, $uid) {
$form = array();
$form['#user'] = $uid;
$form['#action'] = url('linkedin/token/' . $uid);
$form['submit'] = array(
 '#type' => 'submit',
 '#value' => t('Go to LinkedIn'),
'#suffix' => '
' . t('You will be taken to the LinkedIn website in order to complete the process.') . '
',
);
return $form;
}


texts:
I've set GBP as my default and only enabled currency.

I have an exposed filter on my view so users can enter a maximum price. Say the user enters 300 the filter works and displays only items that go up to £300. The same for it the user entered 300.00 - it works.

However, when the user enters 300,000, i think Drupal is thinking of the comma as a decimal, so it thinks 300,000 and 300,00 means 300 and so my view shows results over 300 and up to 300 thousand.

Can I fix this, if so how?
Thanks for reading


texts: Accessing Drupal database for read purposes

texts:
I'm interested in analyzing various aspects of the content in our Drupal site involving node meta data such as type, name, creation date, etc. I know I can create views to show some informaiton and I know I can dump out the database and analyze it separately, but I'd really like to query the database live (for read purposes only) from a remote machine so that I can use the software of my choice to do the analysis, reporting, etc.

Does Drupal have a remotely accessible API that I can use query its database?

(Note: I suspect the "db-api" tag is inappropriate for this question, but I couldn't figure out anything else to use.)


texts:
I have one form of exposed filters of view. I need to override few elements of that, like change options for select box dropdown and like that.

For that I have created view, and used hook_form_alter, but the changes are not reflecting.

My work:

function custom_module_form_alter($form, &$form_state, $form_id) {
    if ($form_id == 'views_exposed_form' && $form['#id'] ==
         'views-exposed-form-advanced-search-page') {

         print_r($form['submit']);  //debug
         $form['submit']['#value'] = t('Search');
         print_r($form['submit']); //debug
    }
}

As shown above, to test, I am just trying to alter the label of submit button, and for debugging, I have added two print_f, statement, output of which are as follows:

First print_f():

Array ( [#name] =>
        [#type] => submit
        [#value] => Apply
        [#id] => edit-submit-advanced-search
      )

Second print_f():

Array ( [#name] =>
        [#type] => submit
        [#value] => Search
        [#id] => edit-submit-advanced-search
     )

As shown, the label is changing, but it is not reflecting to the form.

Considering module weight, I have also tried giving more weight to my module tham views weight. But nothing changed.

Please suggest, if I am missing something.

-- Thanks for your time.


texts:
I have created a form using webform module, and alter form In D7

function mymodule_form_alter(&$form, &$form_state, $form_id) {

  global $user;

  if('webform_client_form_1' == $form_id) {

    $form['#validate'][] = 'mymodule_check_email';

  }

}

function mymodule_check_email($form, &$form_state, $form_id) {

.............

.............

}

I write print_r($form_state); in mymodule_check_email function.

Get all variables but sid value is empty but in database sid insert proper.

My question how to get sid value.


texts: Peer-to-peer recognition system using User Points and Rules modules

texts:
I would like to build a recognition system in the team where peers can recognize the effort of each other. I'm using User Points module.

For example:

UserA recognize the testing effort done by UserB.
UserA login to the recognition system and add 1 point to UserB in "Tester" category.
UserA get 1 point in "Supporter" category since he's recognizing others' effort.

The problem:

How to limit the points to be only +1; not more, not less, negative values shouldn't be allowed, more than 1 is not allowed.
How to automatically add +1 point to UserA who add point to UserB. I tried using Rules module but it always refers to the UserB.


texts: View menu routes missing until first page load

texts:
I having an issue with the installation logic of a custom module. I am trying to add menu links using menu_link_save() that link to a view that is defined in my module in hook_views_default_views().

I am creating a new site using a installation profile that installs this custom module by default. I'm not sure if this is related to being in the install/update environment instead of the normal page environment.

The problem I am having is that the view hasn't created any route in the menu_router table. When I add a link I get a row in menu_links, but the router_path column is empty and the row gets deleted by Drupal when it decides to rebuild the menus.

Is there way to cause the view to populate the menu_router table so that I can add links normally? Is there another way I can use for this? I would like to be able to keep my profile and, rely on a single site install action instead of having to do something after installing, as follow up.

The link never appears; Drupal deletes it from the menu_links table.


texts: How to increase book weight range for a same-level chapters

texts:
I have a book of 33 chapters. These chapters are numbered with roman numbers: Chapter I, chapter II and so on.I'm a blind user, so I can't use drag & drop reorder. In Drupal 7, weight range is -15 to 15.
There is a way to modify this range? Or there is an other module similar to book module, with the same navigation style?


texts: update text format "filtered html" on old nodes

texts:
currently i have a content type with multiple nodes, that were created with a text format of plain text. is there any way to update all these nodes to be filtered html?

/admin/config/content/formats

i changed the default format to be filtered html, by making its weight -10 it is now at the top of the list. now when a user creates a new node it will have this format but how do i convert all the old ones?


texts: Changing default domain in domain access causes 'access denied' for admin

texts:
I'm using Drupal 7 with the Domain Access module version 7.x-311. I've successfully configured a bunch of subdomains running sites correctly, with one subdomain as default.

All worked well until I swapped out the default domain with a new one. Now, every login attempt for admin including  user 1 hits an 'access denied'.

I've updated the domain access settings to set the new domain as default. I've also ensured that the default domain is not set in the settings.php file, plus set the domain cookies settings reflects the top-level domain.

I've also cleared cache and cleared browser cache and cookies, still I get an access denied. I cannot work it out.

Has anyone got advice on where to look next?

N


texts: Why is my custom parameter converter class not used?

texts:
I start banging my head on the table, the wall or anything else... please help me.

Here is my my_module.routing.yml:

my_module.api.validate_coupon:
  path: '/api/v1/{coupon_code}/validate'
  defaults:
    _controller: '\Drupal\my_module\API\ValidateCouponController::validate'
  requirements:
    _permission: 'access content'
  options:
    parameters:
      coupon_code:
        type: coupon_code_converter

This is my services.yml

services:
  paramconverter.coupon_code_converter:
    class: Drupal\my_module\Routing\CouponCodeConverter
    tags:
      - { name: paramconverter }

This is my converter class - it is taken from Drupal\language\LanguageConverter and I added some breakpoints which should make the script stop in my IDE:

namespace Drupal\my_module\Routing;
use Drupal\Core\ParamConverter\ParamConverterInterface;
use Symfony\Component\Routing\Route;

/**
 * Converts a coupon code to a fully loaded coupon
 */
class CouponCodeConverter implements ParamConverterInterface {

  /**
   * {@inheritdoc}
   */
  public function convert($value, $definition, $name, array $defaults) {
    if (!empty($value)) {
      return $this->languageManager->getLanguage($value);
    }
    return NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function applies($definition, $name, Route $route) {
    return (!empty($definition['type']) && $definition['type'] == 'language');
  }
}

And this is my controller class:

namespace Drupal\my_module\API;

use Drupal\Core\Controller\ControllerBase;

class ValidateCouponController extends ControllerBase  {

  public function validate($coupon_code) {
    $container = \Drupal::getContainer();
    $kernel = $container->get('kernel');
    $services = $kernel->getCachedContainerDefinition()['services'];
    ksort($services);
    return array(
      '#markup' => 'hallo'
    );
  }
}

I can enter http://mypath.com/api/v1/1/validate and the controller gets the value '1' for $coupon_code. But I want my CouponCodeConverter class to do some magic before the parameter gets sent to the Controller... but the converter gets not called... what do I wrong?


texts: Custom Content Entity type - allow fields to be managed

texts:
I've created a custom content entity type in Drupal 8. I've tied it in with the Field UI so it can be fielded, and I added some fields in the entity definition using BaseFieldDefinition.

One of the fields I added was this:

$fields['message'] = BaseFieldDefinition::create('text_long')
  ->setLabel(t('Message'))
  ->setDescription(t('The message to be shown'))
  ->setTranslatable(FALSE)
  ->setRevisionable(FALSE)
  ->setDisplayOptions('view', array(
    'label' => 'hidden',
    'type' => 'text_default',
    'weight' => 0,
  ))
  ->setDisplayConfigurable('view', TRUE)
  ->setDisplayOptions('form', array(
    'type' => 'text_textfield',
    'weight' => 0,
  ))
  ->setDisplayConfigurable('form', TRUE);

I want to set a default Text Format for this field, however I'm not sure how to do so. I don't know if I can do it in the code above, but I'm thinking that if I could edit the field settings on the 'Manage Fields' tab, I could do it there. However, I can't figure out how to get my field to show up on that page. It shows up on the 'Manage Form' and 'Manage Display' tab, but not the 'Manage Fields' tab.

Does anyone know how to either get it to show up on that tab, or how to set the default text format on this field?


texts: When does hook_field_storage_details_alter() fire?

texts: I need to modify the field storage details so some additional data can be stored with a form field. I found hook_field_storage_details_alter(), but it doesn't seem to fire. When is this hook used?


texts:
I am developing a Drupal 6.28 core website from a PC and was wondering where I would make drush commands to update the Drupal core to 7.

I am new to Drupal and PC Development, but I assume that it is a terminal command? Can I use the Windows Command Prompt? What directory would I need to be in to successfully run drush pm-update projects drupal-7.


texts: What are search_index & search_dataset tables for, can I clean them?

texts:
I am trying to dump sql from local dev site to production server, I found that search_index & search_dataset these two tables are big, made the sql file really big.

I am guessing these two tables are about storing search indexes which I can always to re-index from scratch later. Correct me if wrong.

So is it OK/safe to delete all the records of them?  then export the database, import to my server. By doing this I can reduce the file size of dump file.

Thanks!


texts: D7 views node references. Do not displays first node

texts:
I have 2 content types: Page and Paragraph.
Page has field node reference which made through view(outputs as checkboxes). View has contextual filter - Paragraph node author id (uid).
I create user, then create 2 nodes of type Paragraph.

Then I create node of type Page and in node reference field I see only one node of type Paragraph. I search for my Paragraph nodes in http://example.com/admin/content and open each paragraph in devel.

Both of Paragraph nodes are published. Both has user id in uid. But in the field I see only one of them.

Trying to figure out what's happening I call views_get_view_result with my view. And see only the second node.

Any help appreciated, thanks!


texts: View doesnt work properly when logged out

texts:
I have a question about a problem I met. I'm working on Drupal 7 site that has a menu made with a view but for some reason the structure of menu is totaly different when user is logged in than when the user is logged out.
Everything works fine when I'm logged as admin but when I logged out it seems like some of configurations doesnt load. I don't have any errors in console.

I`m not sure what kind of informations from view I can share or will be usefull so I will add every need informations which you asked for.

Adding a code from inspect:
Image with both inspects


texts:
I am building a web site using drupal 8 and I want add a mega menu (3 columns menu with images) to the site.

Previously I have used TB Mega menu, but it does not support Drupal 8. Is there any mega menu module that supports Drupal 8, or is there a work-around which allows to install TB Mega menu on Drupal 8?


texts: Javascript translation broken - fixed after cache clear

texts:
I just encountered a problem with the javascript translation. I have a javascript file where I generate small UI elements using jQuery, and I wrap the label in the Drupal.t function. The site is multilingual NL/FR So e.g.:

$('input.button').val(Drupal.t('Dwork'));

For some reason the translation failed; I only got out what I put in: Dutch in this case. After clearing the Drupal cache everything seems to be back to normal. I assume somehow the generation of the french translation js file failed, but I'm unsure how this could have happened.

Anybody know what could cause this, or how to pro-actively refresh the cache?


texts: How do I add rel="nofollow" to links in blocks/menus/etc?

texts: I want to add rel="nofollow" attributes to links that point to login/ToS pages in my Drupal 7 site. How can this be accomplished?


texts: Using sender name and removing HTML entity encoding in Swiftmailer

texts:
I have swiftmailer installed on a Drupal 8 installation. I am using a hook_mail() function to edit the message params as follows:

function mymodule_mail($key, &$message, $params) {
    $options = array(
        'langcode' => $message['langcode'],
    );
    switch ($key) {
        case 'support_form':
            $message['files'] = $params['files'];
        case 'submit_to_admin':
        case 'submit_to_user':
            $message['from'] = array(\Drupal::config('system.site')->get('mail') => 'site admin name');
            $message['subject'] = t('@title', array('@title' => $params['title']), $options);
            $message['body'][] = Html::escape($params['message']);
            break;
    }
}

I am sending the e-mail like this:

$mailManager = \Drupal::service('plugin.manager.mail');
$module = 'mymodule';
$key = 'support_form';
$params['message'] = $message; //defined elsewhere
$params['files'] = $attachments; //defined elsewhere
$params['title'] = $title; //defined elsewhere
$langcode = \Drupal::currentUser()->getPreferredLangcode();
$send = true;
$result = $mailManager->mail($module, $key, $to, $langcode, $params, NULL, $send);

The e-mail is sending fine, including attachments (so I know Swiftmailer must be working), but when I receive the e-mail the sender is listed as just the e-mail address and not as "site admin name".

Additionally, any & symbol in the body is showing up as &amp;amp;

My swiftmailer install is configured according to this guide.

Is there a setting or code piece I am missing that is making this happen?


texts: What's the syntax to apply hook_schema() in .install file?

texts:
I want to build a installable module. Let's assume the module name will be bluedog_calculator. I have already created other required files like bluedog_calculator.info and bluedog_calculator.module. Now I am trying to use hook_schema() and whenever i am trying to use drush dre bluedog_calculator -y, Konsole gives me an error as follows:

  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax;   [error]
  check the manual that corresponds to your MariaDB server version for the right syntax to use near 'unsigned NOT NULL COMMENT.

I am not sure what is the right syntax for applying this hook.

My code is

function bluedog_calculator_schema(){
    $schema['bluedog_calculator_machine'] = array(
    'description' => 'TODO: please describe this table!',
    'fields' => array(
      'id' => array(
        'description' => 'TODO: please describe this field!',
        'type' => 'serial',
        'not null' => TRUE,
        ),
      'name' => array(
        'description' => 'TODO: please describe this field!',
        'type' => 'varchar',
        'length' => '100',
        'not null' => TRUE,
        ),
      'speed' => array(
        'description' => 'TODO: please describe this field!',
        'type' => 'float',
        'not null' => TRUE,
        ),
      'cost' => array(
        'description' => 'TODO: please describe this field!',
        'type' => 'float',
        'not null' => TRUE,
        ),
      'image' => array(
        'description' => 'TODO: please describe this field!',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        ),
      'web_link' => array(
        'description' => 'TODO: please describe this field!',
        'type' => 'text',
        'unsigned' => TRUE,
        'not null' => TRUE,
        ),
      'is_default' => array(
        'description' => 'TODO: please describe this field!',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        ),
      ),
    'primary key' => array('id'),
);

return $schema;
}


texts:
I have a content type with a full person's name in the title, in the format "John Smith". I want to have a view that sorts this content by last name. I've looked at the views interface but I don't see a way to get a substring. (I understand that this won't work perfectly but for our data set, it will work well enough.)

Will I have to add a field of the last name to the content type? Or is there a way I can get views to sort by a substring?


texts:
I have a module that implements HOOK_theme() to define a 'petition' theme like so:

function mymod_theme() {
  return [
    'petititon' => ['variables' => ['foo'=>NULL], 'template' => 'petition']
  ];
}

Which I then use like:

$some_render_array[] = [ '#theme' => 'petition', '#foo' => 'Bar' ];

Which is then rendered by a petition.tpl.php template file.

However, I would like to do this:

$some_render_array[] = [
  '#theme' => 'petition',
  '#theme_hook_suggestions' => ['petition__1'],
  '#foo' => 'Bar'
];

...and have it look for petition--1.tpl.php, in the same way you can for nodes, pages etc.

But this doesn't seem to work. Is it possible to have a theme that can take a template suggestion? I have a bunch of things to render which all require the same processing but use different templates.


texts: How to change a CCK value from a custom module

texts:
I would like to change a CCK value from an action triggered by the user. I built a custom form with a submit button that leads to a hook_validate(). I would like to update a field value from my function. I know the nid and the field_name, I can't find how to do it using CCK API.

Any ideas ?


texts:
function MYMODULE_form_views_exposed_form_alter(&$form, $form_state) {
 if ($form['#id'] == 'views-exposed-form-search-page-1') {
 $form['submit']['#value'] = 'Go';
 $form['text']['#size'] = '100';
  }
}

In the code above, which is the correct way:

   $form['submit']['#value'] = 'Go';

Or

   $form['submit']['#value'] = t('Go');

And:

  $form['text']['#size'] = '100';

Or

  $form['text']['#size'] = 100;


texts: is it possible to view content changes history (author - date) ? We have many users modifying content in our website, and I'd like to know who made each change.


texts:
I have created simple form and page to list records on form via Custom Drupal 8 Module. This form is accessible to only logged-in users with some specific role. It looks like screenshot. Whenever I submit new entry it lists record in via theme table for admin user but it does not appear for other logged-in users until I clear cache manually.

Please suggest, Thanks!

To display Records :

<?php

namespace Drupal\custom_form\Controller;
use Drupal\Core\Controller\ControllerBase;

class DisplayRecords extends ControllerBase {

  public function DisplayCustomRecords() {

    // Display theme table

    $table_header = [
      'name' => t('Name'),
      'mobilenumber' => t('Phone Number'),
      'email' => t('Email'),
      'age' => t('Age'),
      'gender' => t('Gender')
    ];

    $results = \Drupal::database()->select('custom_for_data')
      ->fields('custom_for_data', [
        'name',
        'mobilenumber',
        'email',
        'age',
        'gender'
      ])
      ->execute()
      ->fetchAll();

    $rows = array();
    foreach ($results as $res) {
      $formatted_age = \Drupal::service('date.formatter')->format(
        $res->age, 'custom', 'Y-m-d'
      );
      $rows[] = [
        'name' => $res->name,
        'mobilenumber' => $res->mobilenumber,
        'email' => $res->email,
        'age' => $formatted_age,
        'gender' => $res->gender
      ];
    }

    $form['table'] = [
      '#type' => 'table',
      '#header' => $table_header,
      '#rows' => $rows,
      '#empty' => t('No users found'),
    ];

    return $form;

  }

}


texts: Boost makes the editing of content/settings impossible

texts:
Once the Boost is enabled and I add its code into the .htaccess something weird starts to happen. No changes are being saved when editing the content or settings, after hitting the submit button the page just reloads ignoring the changes, no messages are shown, and sometimes the admin menu disappears. For the not logged in users the Boost works fine, html files are being generated and served. But it makes impossible to administer the site, looks like it affects the Drupal for logged in users as well or something. As soon as I remove Boost's code from the .htaccess – everything starts working again.

Using it on Apache 2.2.29

Tried to set it for the specific pages only, but had no success.

Could you help me and tell what needs to be done?


texts: How do I create a role-specific registration page?

texts:
I would like to create a "hidden" registration page that I can send to our wholesale customers in order to sign up as dealers, instead of standard authenticated users.

As our dealers have access to wholesale pricing, I will require that this type of user be approved by the admin.

I will need to add a few new fields that I would only like to be shown on this dealer-specific registration page (vs. std), e.g. company, company address, POC. Do I create a new template for this form?

How can I add a Honeypot field to this form?


texts:
If I want to add a new tab in the user profile page, let's say /user/%user/resume, should I create a new node type and render it in this tab, or should I declare a table describing a résumé per user, develop add/edit/delete forms and render them in this tab ?

For now, I implemented the second options and I am wondering if it would be easier to do it with the Field API by mapping my SQL table to an entity so that I don't need to create all those add/edit/delete forms. So I have a page callback for /user/%user/resume selecting everything necessary in the resume table and rendering the selected informations with a template.

The sub-question would be : should I always map my SQL tables to entities to benefit the Field API functionalities ?

Thank you,


texts: How to hide the configure slider in MD Slider?

texts: I've installed the MD Slider, but I would like to remove the Edit Slider and Configure Slider links in the administrator role. What function should I use to remove that?


texts: My field group changes are not showing in view mode

texts: I've got some fields in a field group that aren't listening to me. I first created the content type and added about 10 fields, about 8 in one vertical tab, 2 in another. I saved the content type, came back the next day, started making some changes to the display, but none of the new fields I've added show up. I placed fields in the existing groups, created new groups, and at one point did a clone of the form. Is there a known bug, or have I just screwed something up? Either way how can I get my functionality back?


texts: How to get the calculated sell price for the current user?

texts:
Is there a simple way to get the calculated sell price for the current user?

I try to get it from an implementation of hook_field_formatter_view.

Context: I use multiple rules to alter the base price. Work find but I want to alter the displayed price on product page. Sadly, from my hook implementation, the only price I get is the base price.


texts: More options for page--node--edit.html.twig for content type

texts:
Using my Theme debug I'm getting the following themplate suggestions

page--node--blogpost.html.twig

page--node--edit.html.twig

When I tried to use different template to edit a blogpost template only like

page--node--edit--blogpost.html.twig

the template was ignored. How to add more template suggestion for Drupal?


texts:
I’m relatively new to webform and was able to create few with some basic functionalities.
Have a question, is it possible to implement this form (https://www.revenue.state.mn.us/local_gov/boa/Pages/AMA_Registration.aspx) in Drupal 8 webform module without custom code? What webform add-ons should be considered.
It seems like a set of 2 webforms where the fields in the second form are disabled and only enabled when the number in the first form is validated against a list of numbers.
Thanks in advance!


texts:
I need option like on Facebook groups to publish something in group, and then user comment that.

Now i have only comment form which users use to post in groups.

I need something like posting nodes, but in group.

Is this possible?

Thank you!


texts: How do I perform a 301 redirect for all old .asp pages?

texts:
I am trying to figure out a way to redirect all the old .asp pages to a specific page in my Drupal site.

Is there a way I can accomplish this with a web.config file? I cannot use a .htaccess file because the site will still be running on IIS.


texts: can i add multiple value in field ? (please see an image)

texts:
I need to do the stock management website with 2 Content type Supplier and Product.
First I add contents in Supplier content type. Then I add node reference field in Product content type and call it supplier and make it multiple value. it's looks good, i can select suppliers and save it. but in my concept i need to check which supplier sale this product and how price. so i need to add suppliers and price in the same form like my image,

my concept image, create by photoshop, can i do like this ?

the propose of this form, user can check how price of each supplier for this product and they can choose the lowest price for purchase in the next process.

Guys, did you have the idea that i can do like this ?

Thanks for share :D


texts: I am using PHP to determine the subdomain, but changing page doesn't change the result

texts:
In Drupal 7 I am using the Domain module to allow multiple subdomains of the format sub1.example.com, sub2.example.com, etc.
When I am sure that I can correctly identify the current subdomain, I will use a php test in the Block Visibility Settings to decide which menu to show to which subdomain.
To check I can use PHP to identify the current subdomain, I have set up a block with the code.
global $base_url;
$current_path = $base_url . '/' . current_path();
echo $base_url;
echo  "
";
echo $current_path;
echo  "
";

$actual_link = "$_SERVER[HTTP_HOST] $_SERVER[REQUEST_URI]";
echo $actual_link;

The result shows the subdomain from the first page that I access. When I switch page to another subdomain the new subdomain is not shown; the original one is still shown.
How can I can see the correct subdomain for the current page?


texts: Why does webform configuration not let me choose existing content types

texts:
I've installed the Webform module and would like it to configure so that I can add a form to a Basic page content. But /admin/config/content/webform does not let me specify any content types. Where is that setting hidden?
Thanks!
EDIT1
What I'm seeing:---------------------------
What I would expect to see:
Why don't I get the choice of the existing content types??


texts: Calendar With a taxonomy field as filter

texts:
I have created a calendar showing Events in different cities.The City names are taken as Taxonomy and are displayed as a filter.On selecting a Particular city the Calendar shows all the events of that particular city in that month.I want the number of events in that particular city in the filter next to the city name.On clicking the City name in filter it should display the event details under it.
Eg.If Atlanta have 4 events and Chicago have 1 event in July it should be displayed as

Atlanta(4)

Chicago(1)
for that particular month.
On clicking the City the display is like-

Atlanta

Event1
Event2
Event3
Event4

How to get this Functionality please help.


texts:
I am using drupal7 404 page redirect to my custom page using htaccess.

Ex : www.drupal7.com/est link redirect to my custom page. But www.drupal7.com/solution/est link redirect to www.drupal7.com/solution page.

How to fix this redirect issue?


texts:
I've made a image field template called

"field--field-image.tpl.php"

This has override the image field.
But how do I get the image to display

<img src="<?php print render($item); ?>" alt="..." class="img-rounded">

Many thanks for your help


texts: How to determine if {{user_picture}} is not empty in the comment.html.twig template

texts:
Trying to determine if {{user_picture}} is not empty in the comment.html.twig template.
{{user_picture}} refers to the Compact display mode for a User Entity.
The below code doesn't work.
{% if user_picture is not empty %}
      {{ user_picture }}
    {% else %}
      <img src="images/default_image" width="42" height="42">
    {% endif %}

Also tried this with no success...
{% if user_picture|render is not empty %}

Researched a bunch, and couldn't find any problems/solutions with this use case. What am I missing?


texts: Create user programatically after e-mail verification

texts:
I am programatically creating user with this code:

    $new_user = array(
        'name' => $state['unique_name'],
        'mail' => $state['values']['email'],
        'pass' => $state['values']['password'],
        'status' => 1,
        'init' => $state['values']['email'],
        'roles' => array($role->rid => $role->name),
    );

    $account = user_save(NULL, $new_user);
    _user_mail_notify('register_pending_approval', $account);

This code is creating user and should send verification email, after which user should be able to log in. Problem is that users are able to log in immediately.

  Please note that I work on localhost and cannot send email from
  localhost. I will have very little time to test site on real server,
  so I would like to know the solution in advance.

The solution could be this approach:

  The only way I was able to accomplish this was by setting the users' status to 0, then sending a custom email with a link to a custom verification page. The link contains the ID of the user and a hash of a private key concatenated with the user's email. On the verification page, I pull the user's email from the database based on the ID in the URL, concatenate the private key to the email and hash it, if the hash matches the hash in the URL, I set the user's status to 1, enabling the user to login.

But the next question is how to generate that "private key" from user database datas and from email link. I can't see any private key of user in drupal database.


texts: jQM Theme does not work properly on front page

texts:
I've started to use Drupal recently, and installed the jQuery Mobile module and the jQM Theme in order to make a Mobile site / Web app.

I'm having some troubles getting it to work properly.

The thing is, that when I go to my sites front page, I get this view:

However, if I click on, let's say 'Store Locator', I get this view:

So my problem is, that it seems like the jQuery Mobile stuff (js or css) does not load correctly on the front page.

If I inspect the page, it seems to be the right template, but somehow the js og css isn't loaded correctly.

Has anyone had the same problem?


texts:
I've been searching a lot for this, but no luck.
I've created a custom file field along with an instance for my custom content type in the .install file.

I've set up everything except that I want that by default this instance of the file file that I created to upload to the 'private' directory and if it's not defined, to define it with this module.

  $file_download_link_instance = array(
  'field_name' => 'file_download_link',
  'required' => true,
  'entity_type' => 'node',
  'bundle' => $machine_name,
  'label' => t('Files to upload'),
  'settings' => array(
    'file_extensions' => 'txt doc docx pdf ods odt xls xls png jpg jpeg',
    'description_field' => TRUE,
    ),
  'description' => t('Please upload here the files.'),
  'display' => array(
    'default' => array(
      'type' => 'hidden',
      ),
    'teaser' => array(
      'type' => 'hidden',
      ),
  ),
  'locked' => TRUE,
);

I believe that I have to edit the 'settings' array, but I don't know the syntax.
Thanks!


texts: I am currently using drupal 7 for my site. I recently read about Pressflow for drupal and it seems to provide better performance compared to the regular drupal 7 version. I have a quite a few custom modules and if I have to migrate to pressflow later, do I have to modify the modules to support pressflow? Also, are there are any issues on migrating from drupal 7 to pressflow?


texts: How to change Display modes per node (view modes)?

texts:
In Drupal 8 views modes are supported by Core, which makes entity view modes obsolete. I will like to have the ability to change my view mode per node without using Display Suite.

Does anyone know if I can do this by only using Drupal core or a lighter contribute module than Display suite for?

Ideally, I will have a select list to pick my view mode from the UI at the node level.


texts: VBO calls entity_save after custom action is triggered. How to stop that?

texts:
I have VBO custom actions defined and it gets triggered. Also, I do NOT have 'behavior' => array('changes_property') defined in my hook_actions_info() as described in How to create custom VBO action?

I see that my custom action is getting triggered and does custom operations and finally saves by creating new node revision. Weird part is that entity_save operation is being called after this and it is updating node table with older version of node rather than new vesrion created by custom funtion.

How can I stop or prevent vbo to call entity_save and just perform custom action?

Any insights will be greatly helpful.

Thanks!


texts:
I load external feeds and i show thumbnails from external links.

I have big problem with Google PageInsight.

Images are not in my server, they are links from feeds. How can I compress those images from feed ?


texts: Easiest way to expose existing data in secondary database as entities?

texts:
Given a "node-like" database table in an "external" or "secondary" database, what's the easiest way to expose them as entities?

Documentation for the entity module makes it seem easy for data stored in the local database, but I'm not sure how that can be translated to another db.


texts: Enforce rule on Sticky to the top of lists

texts:
I have x amount of nodes of content type "job", all of which are presented on page using two views, one that sits at the top "job-highlighted" and one that sits at the bottom "rest-of-jobs".

One job is selected to be displayed in the top view. It is selected using the "Sticky at top of lists" option in the back end.

The rest are displayed in the "rest-of-jobs" view.

The problem is that the user can set a number of jobs to have the sticky at the top of lists selected.

My question is, is there a way to enforce the content type job to have only one node with the sticky at the top of lists functionality. Can I implement a procedure that updates these or is there a module that already introduces this functionality?

Can anyone offer a solution. Thanks in advance.


texts: Node References, new Node button for the referenced Node

texts:
I'm using References Module + cnr module for having bidirectional node references between two different node types (Say Brand and Product).
So Brand can have many products but product has only one brand.

I want a "Create Product" button in the Brand page, that opens up a form to create a product where the Brand relationship/reference is already defined. What's the best way to do this? (in the other scenario of a "regular" add content, it should have the select control to choose the Brand from a list (or the auto-complete, doesn't matter)

Also, I would like to NOT display the list of referenced products in the Brand Create/Edit form, I do want them to be displayed on the rendered node page as a list.

As a side question (since this combination is already working for me), since it was anounced the References module is on its way out, and to be replaced by Entity Reference module - what would be the best way to achieve the same functionality using that module (just found This module ) which might be what I was looking for.


texts: How to migrate files together with additional fields

texts:
In my Drupal 8.4 installation I use the module File Entity. In the module are defined a few additional fields: 'author', 'title', 'alt',... My migration works. The files are imported, but the additional fields are after the import empty.

The complete YML (modules\my_migration_module\config\install\migrate_plus.migration.files.yml) looks like:

langcode: en
status: true
id: files
migration_group: import_xml
label: 'Import the test XML file'
source:
  plugin: url
  data_fetcher_plugin: file
  urls: 'http://example.org/test.xml'
  data_parser_plugin: xml
  item_selector: /imports/files
  fields:
    -
      name: id
      label: ID
      selector: ./@id
    -
      name: title
      label: Title
      selector: ./@title
    -
      name: alt
      label: Alt
      selector: ./@alt
    -
      name: author
      label: Author
      selector: ./@author
    -
      name: filename
      label: Filename
      selector: ./@filename
    -
      name: uri
      label: URI
      selector: ./@uri
    -
      name: target
      label: Target
      selector: ./@target
  keys:
    - id
  ids:
    id:
      type: string
process:
  field_alt: alt
  field_title: title
  field_author: author
  filename: filename
  uri:
    plugin: download
    source:
      - uri
      - target
destination:
  plugin: 'entity:file'
  source_path_property: uri
  destination_path_property: target
template: null

E.g. for the field title I have tried:

field_title: title
title: title
field_title/field_title_value: title
field_title/field_title_value: title
field_title/field_title: title
file__field_titel/field_title_value: title
file__field_titel/field_title: title

I have found a solution for a similar problem in Drupal 7: How to migrate fields attached to files? I'm not sure, how can I implement this in Drupal 8.


texts: How to render node content according to site theme after hook_node_insert/update?

texts:
How can I get the actual HTML of the node when i am in hook_node_insert/update?
I would like to get the rendered HTML as it should appear in the site and save it somewhere else ...
I am working in drupal 7.


texts:
Can somebody tell me if node filtering within Views is done by using node_load then checking it's fields, or by first filtering out the node table rows and then loading nodes using node_load?

I'm going to have tons (100,000+) of nodes and every time a View does a node_load on all of them will be very slow operation.

I've no idea how slow it'd be loading 100,000 nodes using node_load.


texts: Adding extra parameter to hook function in custom module / get custom variable inside a hook from outside of that hook

texts:
I would be glad to pass an extra variable that is created outside to the inner function in my custom module. That inner function is a hook. But i can not pass variable as an pareamter of that function, or could I ?

Nice to have ;) :

$foo = 1;
function hook_tapir_table_alter (&$table, $table_id )  {
echo $foo;
}

As a workaround, i can wrap $foo in a function and do i this way

function process_vars () {
    $foo = 1;
return $foo;
}

function hook_tapir_table_alter (&$table, $table_id )  {
    echo process_vars ();
}

How could i go without function call to outside function ? Any clues? Thanx!


texts: On account creation, the message is not displayed

texts:
I try to register in my site; after a successful registration, I get redirected to the home page, but the following message is not displayed.

  Thank you for applying for an account. Your account is currently pending approval by the site administrator.

  In the meantime, a welcome message with further instructions has been sent to your e-mail address.

The standard core mail functionality is used, and no hook or rule is used for that registration.

Why doesn't the message appear?

I tried changing theme, but the message is still not appearing. Furthermore:

The $message variable is available in the template file
I am not using the Boost module; I am using the Mime Mail module to get HTML emails

How do i customize the message in some hooks?


texts: How to prevent pager_default_initialize from getting initialized?

texts:
I'm calling this function pager_default_initialize on a certain condition. But once this function gets called, it initializes default pager everywhere I return theme('pager').

What I want is

if(condition == TRUE)
pager_default_initialize($total, $limit, $element = 0) get executed
theme('pager') works!
if(condition == FALSE)
pager_default_initialize($total, $limit, $element = 0) not get executed
theme('pager') should stop work. I don't want pager when condition is FALSE.

but problem is once condition == TRUE gets satisfied, I got pager everywhere.

Any  way to uninitialize this pager function on certain condition?


texts: "Output this field as a custom link" set here link to the content

texts:
How to set in "Output this field as a custom link" a link to the content.

In drupal 7 it looks like this:

https://www.drupal.org/node/1578524

Tried this, but this doesn't work:

Replacement patterns in image field:

And in link to content field:


texts:
I have a custom content type movie. Now, when I visit any of the movie content, the url is like:

mysite/?q=node/someNumber

I want that every movie content will have url like

mysite/movie/somenumber

or,

mysite/?q=book/someNumber

How to do this?

I am using Drupal 7.


texts: custom form module not showing upload functionality

texts:
<?php

function form_test_menu() {
  $items['formtest'] = array(
    'title' => 'Form Test',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('form_test_form'),
     'access callback' => TRUE,
    );
   return $items;
}

function form_test_form($form,&$form_submit) {
   $form['firstname'] = array(
    '#title' => t('Firstname'),
    '#type' => 'textfield',
    '#required' => TRUE,
  );
    $form['lastname'] = array(
    '#title' => t('Lastname'),
    '#type' => 'textfield',
  );
  $form['submit'] = array(
    '#value' => 'Submit',
    '#type' => 'submit',
    );
  return $form;
}

Hello all,

Can anyone explain to me why this will not work?  I am trying to test the form submission and I created a module folder with a .info file.  I am using mywebiste/formtest, but every time I try and load the page it says "page not found."  I have been looking at tutorials and they all seem to work fine but it seems that I must be doing something wrong.  Any thoughts?

Any and all help is greatly appreciated, thank you in advance.


texts: printing an entity reference field in a special display mode

texts:
I have an entity reference field. The referenced entity has multiple display modes.

I'd like to print this field 2 two times in a template, with 2 different display modes like so:

{{ content.field_ref_entity.display_mode_xy }}

and

{{ content.field_ref_entity.display_mode_yz }}

Is it possible to define the display mode of the referenced entity in field printing? If yes, how?


texts:
I want to add a character counter on a textarea field on Webform.
I tried the Maxlength module but it doesn't work (I can't find any reference to it on editing the field) and I read it works only for content types, not Webform.

Then I installed  Webform Countdown and added this code to my sites/all/libraries/word-and-character-counter/word-and-character-counter.js (Yes, I installed Libraries Module as well) but I don't really know what should I do now. Am I supposed to see something about it on editing the field? I can't find anything.

I'm also using Webform Validation and limiting the max lenght of my textarea fields. It's working fine but I also need something to count the chars as the user is typing.

Can anyone please help me? What's the best solution for this?

Thank you in advance!!


texts: Text formatting in the "Help Text" section

texts:
I'm wondering where the formatting is set for the "Help Text" section. I was thinking that maybe it was plain text, but it does not appear to be so - I want to use the module Collapse Text to collapse the text and make the help text available to the user only if they want to view it, while filling out their registration form.

Is there a way to do this, or will I have to write a third party module?

This is the module I want to use with the help text.

https://drupal.org/project/collapse_text


texts: Is it possible to hide certain content type options?

texts: I have a module which creates a new content type attached to a Feed. For this content type having options such as "Comment settings" or "Revision information" makes no sense. Is there a way to hide those?


texts: How to display all product prices on the page at once with Drupal commerce?

texts:
I have several products related to a single product display node using Drupal Commerce.

Currently this page only shows a single price (related to the product option currently selected in the dropdown). The only way you can see the prices of the other products is to change the dropdown, which invokes an AJAX request to reload the current product options (including price).

Obviously this is counter-intuitive for customers, who are used to seeing all of the prices available at one time, and not having to change to a new option with the dropdown just to see the price of that option.

How do I change this display so it functions like a traditional e-commerce website? By that I mean either a dropdown that contains the product name AND product price, or (far more preferably) a table with the list of available products, with their prices in one of the columns?

I can only assume that this very basic functionality must exist somewhere in the Commerce configuration settings somewhere, but as yet I haven't been able to find it.

I could easily write a module to code round this problem, but I'm currently evaluating Commerce to see whether it's good enough for our agency to use in future e-commerce projects, without having to re-invent the wheel over and over again. To that end, answers involving code probably won't be too useful.

Muchas gracias


texts: Programatically add module block to dashboard

texts: Is there a way in which from my .module file I can assign a block in a specific region from Dashboard?


texts:
I am trying to programmatically set a link in a Drupal 8 view. The client wants an external link used if a certain link field is set, otherwise default the link to the node.

I am trying to figure out how to set this, and despite looking at hook_views_pre_render() and hook_views_post_render(), I'm not seeing any method to make this happen. I'm trying to go into result -

foreach ($view->result as $key => $value) {

}

However Kint is giving me data like this:

public _relationship_entities -> array(0)
public index -> integer7
public node_field_data_langcode -> string(2) "en"
public nid -> string(2) "99"

for each ResultRow.

I don't remember this being particularly difficult in Drupal 7 - is there something I'm missing here? How do I programmatically set a link in Drupal 8 dependent on certain conditions for a view row/field in a row?


texts:
I am creating a web service for login and register, but I want a single URL for register and login so that, when a user registers, it will automatically log in. No need for two services for register and login.
How can I get this?


texts:
I want to use the power of views to handle my data which comes from simple xml representing just a grid resp table

<list>
  <listpos id="12312">
    <foo>attr1</foo>
    <bar>attr bar</bar>
    ...
  </listpos>
  <listpos id="124412">
    <foo>attr 2</foo>
    <bar>attr barxy</bar>
    ...
  </listpos>
  ...
  ...
</list>

So the main task is to display that table sortable, exclude some columns, filter and search etc.

Is this possible with views? It would be handled by a plugin i guess? Or are plugin only for output? (I know of the json, atom etc plugin / modules.)

I also tried the feeds module plus xml / xpath parser and let the importer create the nodes so a view can display them. But I have to delete them anyway after user logs out because it's sensitive data and should not be kept on the webserver.

And what about combining this data with other sources i.e. join with a node table?


texts: Trouble displaying different info for same role/node type

texts:
In D7 I am trying to display different information to different users with the same role. The 2 types of roles are 'Renter' and 'Landlord'. I've tried creating different views, but currently all renters and all landlords can see all renter info and all landlord info.  I've tried Display Suite, Views, References, Entity References, all with no luck. :(

Ideally Larry Landlord would be able to see a list of all of his tenants (renters) with their addresses, rent amount, date of last rent payment, if the payment was processed, and if the rent is overdue. But currently he can see his info, and the info for the other landlords and renters.

Any thoughts?

Thanks!

After creating views and setting up an Entity Reference field, I am still having difficulty displaying the views I need. I'm trying to tie a renter (tenant) to a landlord, which would be a 1:1 relationship, and allow that one renter to see their history with their landlord. I am able to display all landlords and all renters, but when I try to create the 1:1 relationship that's where it falls apart. I may need another view, but I'm not sure how to connect the various views.

Any thoughts?


texts:
In Drupal 7 (I also have the Media module installed), there is a functionality in
/admin/content/file

that lists all files being uploaded. If you click on a single file's "Usage" link, you can see exactly how many times that file has been used in the whole site, I would like to order that table by the column "Usage" to see files that haven't been used and then delete them.

Unfortunately it's not possible to order that column. Is there another way to achieve this? Is Views Bulk Operations the best available option?


texts: Include the user history visibility settings in a feature

texts:
I have two view modes for the user profiles, the default one and a custom view mode called "Header". In the default view mode I have chosen to show the user history information ("Member for...") but in the Header view mode it shouldn't be shown.

I have included the user account settings in a feature in order to be able to export them. Everything else is fine but I don't find how to include the history visibility settings in it. When I reinstall the site with my feature, the "Member for..." information is shown in both of the view modes. I can manually hide it in the configuration page, but I must find how to export it into the code.

Does anyone know how this can be done?


texts: Module to add keyword search capability to content admin page?

texts: Is there any module or technique for D7 that can provide this functionality?


texts: check "checkbox is checked" before submit

texts:
I created a template for a content type. This content type has a field of type radios, with values 0 and 1.

My requirement is to display a Submit Button if "1" is selected, and then hide when "0" is selected.


texts: Batch removal of users and comments without causing excess load on server

texts: I have a basic shared hosting account and don't want/plan to upgrade anytime soon. Unfortunately, my site has been subjected to large scale attacks by spambots that have lead to the generation of thousands of spam comments and users. I would like to delete these, but deleting them in batches causes the server to crash, every time. What should I do to avoid these crashes?


texts: Full Html Text format (and wysiwyg) show only for administrator role

texts:
I use Wysiwyg module with CKeditor since months and all worked well.
Wysiwyg module is linekd only wit my input-format "Full html" and this is granted to use to my role "Editor". it worked very good.

Unfortunately, since the last Drupal core update i have a big problem:

it seems that only Administrator users can use the FULL HTML text format, my other roles don't see that format and so also the Wysiwyg module doesn't appear.

I've done many checks and tests (permissions, cache etc) but the only thing i discovered is that is a problem of permission on the TEXT FORMAT and not on the wysiwyg module...
The proof is that if i apply wysiwyg to the "Plain text" format, also the EDITOR role see the wysiwig editor.

how can i fix this problem? i also tried to remove and re-set the permissions for the role to use the "Full HTML" format


texts:
hi suddenly i started to get
Fatal error: Unsupported operand types in E:\localhost\htdocs\drupal\modules\field\field.info.class.inc on line 479

any page i visit just display this error

how to fix this ?


texts:
I have a requirement where I need to show latest discussions (using Advanced Forum module) using views. The tricky thing here is that both replies and topics need to be treated equally and the one more recent should be displayed on top even if they are part of same thread.

For example, user A creates a new topic/post X, B replied on it (lets call that reply Y) and then user C created another topic Z. In such case the order of the items in the module should be as following.

Topic Z
Reply Y
Topic X

Note that even the reply is shown. Now, topics and replies can be sorted independently in a view however how to sort them in combination is the issue.

Any help would be appreciated.


texts: Drupal 7 skip loading the template for ajax requests

texts:
I am trying to upload an image in my template page, using jquery ajax-form submit.

And i am returning just the image name after it is uploaded in the module function.
However, i am getting the entire html as response.

In my theme's template.php, i have used the following code:

function my_theme_preprocess_page(&$vars) {
  if ( isset($_GET['ajax']) && $_GET['ajax'] == 1 ) {
        $vars['template_file'] = 'page-ajax';
  }
}

I have this code in my theme's page-ajax.tpl.php: <?php print $content; ?>

And i am passing the 'ajax=1' parameter to the module hook menu function that handles the image upload.
How can i just output the image name in ajax response, instead of the entire html.tpl.php?


texts:
I have a Drupal link field configured to allow both internal and external links and have the title field enabled, but optional.

I want users to be able to reference internal entities without having to specify anything in separate title field, and have the Link field's title pulled from the entity label.  However it appears that when the field's internal title value is left null, Drupal ends up using the field's uri value as the link title. This behavior seems odd to me.

My question is this: given an internal uri value that looks like: entity:node/3500 how can I preprocess or alter the functionality of the Link field to load in the entity's title/label as the  title when it is left empty by the content editors.

I've searched for issues on drupal.org but didn't turn up much of anything useful. I found Get title from Route, which seems to recommend using the TitleResolver, but that depends on putting together a $request object, which seems extremely impractical.

Suggestions?


texts:
If I'm making a theme that I want multiple people to be able to download and install (not just making it for one client), what's the best way to include the content types? For instance, say it's a portfolio type of website, and has a content type called "project". I don't want anyone who downloads my theme to have to go in and create the content types by hand.

What are best practices in distributing a theme with requirements like that? Is there a simple module I could expect someone to install first?


texts: Two columns on frontpage with a CCK form and a node list

texts:
I want to show a simple frontpage that contains a content creation form (cck) on the left side and a list of nodes on the right side. With a head and a footer, the page looks like this:

I have looked into doing this with the Panel module, but it seems like overkill and I don't think it plays well with the grid layout I use.

I have also looked on doing this with the Views module and the Context module, but I don't really understand how I can execute the code for rendering the content creation form with this approach.

A third solution is to override the template for the page-front and hard code the rendering there, but a drawback would be that I then need to maintain multiple page templates.

So what is a good solution for this do you think? I would like to involve as little complexity as possible and my head is already spinning with all these modules for such an apparently simple problem.

Appreciate guidance from someone who is fluent with View, Context, CCK and Panels.


texts: Changing the Open Atrium 2 login hyperlink

texts: How do I change the open atrium 2 login hyperlink for anonymous users so that they can register instead of being directed to the user login page?


texts: jQuery Autosize for comment form in a colorbox?

texts:
I am struggling with jQuery Autosize for a comment form in a colorbox. I would like to pass it as a callback from script.js, but seems not to work:

$.colorbox.settings.onComplete = function() {
$('textarea').on('focus', function(){ $(this).autosize(); });
}

Is there a way to achieve having a onComplete callback for the jQuery Autosize for the comment form in the colorbox?
And I cannot achieve this functionality with bind('cbox_complete', function() neither..

  $(document).bind('cbox_complete', function() {
        $('textarea.form-textarea').on('focus', function(){ $(this).autosize(); });
  });

Any help will be much appreciated.


texts:
I would like to implement smooth scrolling on my page made in drupal 6. I have a list of topics on top of the page. I would like the page to smooth scroll down direction to the topic. Can any point me how to do it in drupal 6?
thank you


texts: I want to list all the users who have ever contributed to the revisions of a node.


texts: How to preserve the values of paragraph fields in migration?

texts:
I am migrating content with paragraph fields.
My paragraph migration.
langcode: en
status: true
id: my_paragraph_import
label: Paragraph import
migration_tags:
  - paragraph
  - my_paragraph_import
source:
  plugin: contact_person_csv
  delimiter: ','
  enclosure: '"'
  escape: '`'
  header_offset: 0
  ids: ['personal']
destination:
  plugin: 'entity_reference_revisions:paragraph'
  default_bundle: organisation_member
process:
  mail:
    - plugin: skip_on_empty
      method: process
      source: 'e-mail werk'
  cellphone:
    - plugin: skip_on_empty
      method: process
      source: 'gsm werk'
  phone:
    - plugin: skip_on_empty
  method: process
  source: telefoon
dependencies:
  enforced:
    module:
      - migrate_source_csv

My content migration:
langcode: en
status: true
id: contact_person_import
label: Contact persons
migration_tags:
  - node
  - contact_person_import
source:
  plugin: contact_person_csv
  delimiter: ','
  enclosure: '"'
  escape: '`'
  header_offset: 0
  ids: ['personal']
destination:
  plugin: 'entity:node'
  default_bundle: contact
process:
  type:
    plugin: default_value
    default_value: contact
  title: title
  first_name: 'first name'
  last_name: 'last name'
  my_paragraph:
    - plugin: migration_lookup
      migration: my_paragraph_import
      source: personal
  paragraph_field:
    - plugin: sub_process
      source:
        - '@my_paragraph'
      process:
        target_id: '0'
        target_revision_id: '1'
dependencies:
  enforced:
    module:
      - migrate_source_csv

I executed the migration. The migration works fine. The nodes with paragraphs are migrated.
In the paragraph, I have another field Function, which I did not map in the migration.
After the content migrated, I updated one node and filled in the Function field in the paragraph.
Then I executed the migration again, then when I edited that node again, The value from the Function field has been removed.
While the other fields of the node preserved the values but not in the paragraph.
Is there any way to preserve the paragraph field values after re-migration?