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

Call to undefined function gcd

I am making a custom module in which I am calling a function inside another function. I have defined that function in the class but I am getting this error call to undefined function gcd. I am sharing the code. Kindly look at the code and tell me what I am doing wrong.

Code of my Custom Module

Select callback on change in a custom form

Hi all, 

I'm on drupal 8.6, working with a custom module.

I've an entity form with some controls; one is a Select which show some elements; I need to send a postback (not ajax) when a user choose one of the elements and manage it as a callback; something like an action but with a select instead a button. 

Is it possibile? How? 

Thank you in advice. 

Stelvio

 

How to execute something before a cached REST response

Hi.

I have a Drupal REST which bring me cached data, working as expected.

Now, I want some code to run before that response is generated. I need to do always a check in order to decide if to invalidate that REST cache or not, before it will be generated and sent to user.

Why Can't I Hide Empty Fields in tpl File

I am trying to exclude fields if they are empty, on the portfolio page I am creating with node--portfolio.tpl.php.  I have tried several different ways and variations on each including:

             <?php if (render($content['field_portfolio_video'])): ?>
                     <h5><?php print t('Related Videos'); ?></h5>
                     <?php print render($content['field_portfolio_video']); ?>
             <?php endif; ?>

and 

link from image, drupal7

in a module, I try to make a link from an image, but I get the code instead of image. I red that I need to use "html TRUE" but I still do something wrong

here is my code

How to specify AND, OR with dynamic query

I’m trying to create a dynamic query, the query logic conditions needed are: AND, and OR.

The main query will include two sub queries.

The ConditionInterface::condition documentation states that:

“If called with 1 parameter, it should be a ConditionInterface that in itself forms a valid where clause. Use e.g. to build clauses with nested AND's and OR's.

Pages

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