Remove 'field_' prefix from custom fields name in Drupal 7 (D7)

Submitted by admin on Mon, 05/08/2023 - 10:22
I'm creating shop like app with Flex frontend and Drupal 7 backend for our offline retail sotres (it started from simple products availability DB, so I don't wanted to pay for monster all-in-one commercial soft). The point is now it grew up to many lines of code and I wanted to move to AMFservice for Services 3 module to send typed data to Flex...


Flash + Drupal 7 using AMF Server (setup problems solved)

Submitted by admin on Mon, 05/08/2023 - 10:21
Seems like today it's very simple to get good comunication betwen flash (frontend) and drupal 7 (backend), good people had wrote just great API to make your work as simple as possible... but there are spots even in the sun. Here are my steps to make them workin' on D7 + Flex SDK 4.5.

Drupal 7 свои кастомные поля (custom fields) c использованием Field API

Submitted by admin on Mon, 05/08/2023 - 10:17
Предстоит написать несколько модулей для кастомных полей, поэтому для себя создал этот документик, чтобы возвращаться к нему потом и быстро перечитывать для чего нужная какая функция... и не наступать на грабли, которые почему-то не были освещены в других уроках, которые я находил в сети (когда виджет редактирования поля есть, данные записаны правильно в $form_state, а сохранения поля в таблицу базы данных не происходит). Цель создания - иметь друпал поля с возможность записывать несколько отдельных данных в одном поле (compound fields).

EntityMalformedException: Missing bundle property on entity of type ... in entity_extract_ids() (line 7734 of \includes\common.inc) SOLVED

Submitted by admin on Mon, 05/08/2023 - 10:11
Writting my own entity types admin page forced me to solve some annoying not understood for me and not documented errors and "missing bundle" is one of them. Received after editing the existing entity. Why the system do not set it mannually? To not go longer in thoughts when we need the result FAST the easy fix is...

Load Drupal Entity - more readable code (easy one-liner)

Submitted by admin on Mon, 05/08/2023 - 10:09
In my project (on Drupal 7) I'm using EntityFieldQuery alot to get some entities with given conditions, but working with resulting array of execute() function - is boring and makes code dirty IMHO. So I created helper class used only to load entities. Most of the time result is self describing one-liners instead of variables mess. I know it not covers all posibilities of EntityQuery, but 90% of my usage of it is loading Entities with some conditions. With the help of my class, loading one entity with conditions will be as simple as: