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

Class does not exist in ReflectionClass->__construct()

Problem that I didn't manage to fix

I got this error after I did the following:

  • Made a custom module in which I implemented a class that would subscribe to an event with a method

    • couldn't find out how to find the name of the event I was supposed to subscribe to in the return statement (you know, something like ConfigEvents::SAVE or something) so I gave up on this

Node or Entity

I need to build a data-centric module which will have about 100 fields and over 100,000 records, for logged in users' viewing only.

I can save all fields in one DB (i.e. as an entity) or have each field has it's own table (i.e. make it a node).

Which approach would be more practical (I am inclining towards single DB table). Has someone done any speed analysis on a similar scenario?

Thanks,

Nick

Address field. Accessing Country value

Hi
I'm using the address field in Drupal 9 for Country only.
In a module I process the form values after submit and send them off to a CRM.
I decode the values first with $arr = json_decode($values, true);

Simple fields are fine and I get the values OK using $arr['email'] for example.

How can I access the selected country value?
All Ive got so far is "Array"

Thanks

How to output value of a property in a stdClass object?

I have a field that is structured like this:

field => stdClass Object
(
    [__CLASS__] => stdClass
    [uid] => 1
    [type] => article
)

I try to inspect like this:

dpm($field->type, 'field->type');

And get the following output: " field->type => article", which is reasonable.

However, I also get the following notice:

Notice: Trying to get property 'type' of non-object in …

Adding combined fields to new content type

Hi there,

I'm trying to set up a site using Drupal for the very first time, but I don't know what's the best way to accomplish the following:

Pages

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