How to change the function that occurs when clicking the Create App button?

surik-babu
Participant II

How to change the end point URL in create APP.

In Drupal Developer portal where can i see the action of Create APP function. If i need to add my my own action to that button create APP. How to do the same.

My use case is need to change the button functionality

5762-capture.png

0 7 207
7 REPLIES 7

What do you mean by "end point URL" ?

I don't see anything in the screenshot that says "end point URL" ?

Also I don't know what you mean by "how to check this particular page".

what are you really asking?

surik-babu
Participant II

In Drupal Developer portal where can i see the action of Create APP function. If i need to add my my own action to that button create APP. How to do the same.

My use case is need to change the button functionality

That page is rendered by the devconnect_developer_apps_edit_form function. It's actually a "form", in Drupal. Yes, "apps_edit_form" for adding an app. It's the same form used for editing an existing app.

In Drupal, You can hook the form submission. This means you can provide custom code that runs, before, after, or around the default form submission handler.

This article describes the basic idea.

In more detail, you would

  1. write a new drupal module
  2. provide code in your module that hooks "form_alter" to insert your own form submission logic. Something like this:

    <?php
    function YOURMODULENAME_devconnect_developer_apps_edit_form_alter(&$form, &$form_state) {
    
        // choose one or both of the following: 
        // A. run your logic AFTER other form submission logic:
        $form['#submit'][] = 'YOURMODULENAME_newsubmit_function'; 
    
        // B. run your logic BEFORE other submit logic:
        array_unshift($form['#submit'], 'YOURMODULENAME_newsubmit_function');
    }
    
    function YOURMODULENAME_newsubmit_function($form, &$form_state) {
       ... do your stuff here ...
    }
    	

Keep in mind you need to handle the add case, as well as the edit case.

I'm curious; what specifically do you need to do during form submission? You may alternatively want to take advantage of form validation. See this Q&A for more on that.

Please let me now the steps where to look the rendering form in Apigee Developer portal .

Hi. I don't understand your question.

unable to find the node list , Please share the steps to find node

Example: user/54/apps/add

I answered that question. Did you read what I wrote?