This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Can't set value on entity form save

Hi,
In entity form (entity = message) I have buildForm function and save function.

Before to save the message I need to populate a text field.

I have already tested :

$form['sent'][0]['#value'] = "hello world"; in buildForm

in save function :

Return data fast from large query on thousands of records

We have a very large Drupal 7 application which we have built for a client. They have large numbers of their clients logging onto the system at all hours across the globe, to query thousands of rows of data. (sorry for my technical ignorance I am fairly new to Drupal). Our developer has used Rules module to generate queries and I believe Views to return the results. Some queries take over 5 mins. we have a very fast web server with 128gb ram. Is using the Rules module a good way to return this data or should we be writing db_query... in code?

Migration

When I try to migrate content while I have the domain access module, I get this error

InvalidArgumentException: Field field_domain_all_affiliates is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 587 of /var/www/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php).

This field is in my content type, and I have excluded this field from my migration script. 

Prepopulate Calendar Popup Field with Variable

I have a fairly complex medical website that requires an intense node with fields to be completed by the visitor.  It is NOT a Drupal webform, but a node.

I'm passing a date VAR in the url and would like to set the default date in the calendar popup field to that VAR when application page loads. 

Can someone help me by explaining how to do this?

When to build a custom entity programmatically versus YML

I don't fully understand when I should build a custom entity via YML or programmatically. I can do both, but I don't fully understand the tradeoffs of each or why it should be done one way versus another.

Is it basically that they offer different levels of customization: YML doesn't allow me to customize the storage schema or build custom routes, etc?

Difference between last installed schema and current schema.

Hello, on the last update I ran into the issue with schema update.

We overrided content entity class with id = menu_link_content. And we added new field called machine_name by this method:

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions