Skip Navigation

[Resuelto] Undefined index api_used in toolset-common-functions

This support ticket is created hace 6 años, 4 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Este tema contiene 18 respuestas, tiene 3 mensajes.

Última actualización por Beda hace 5 años, 1 mes.

Asistido por: Beda.

Autor
Mensajes
#948274

Hi,

I'm having this PHP Notice on the page with content submittion form:

Notice: Undefined index: api_used in /home/c/.../.../public_html/wp-content/plugins/toolset-maps/includes/toolset-common-functions.php on line 1016

Notice: Undefined index: api_used in /home/c/.../.../public_html/wp-content/plugins/toolset-maps/includes/toolset-common-functions.php on line 1018

It was not there when I saw the site last time.

I'm providing you with the access to the WP admin so you can check. Go to enlace oculto and click "Start evaluation" to see it.

Please advise.

#948299

Another issue with the same site:

Notice: Trying to get property 'post_type' of non-object in /home/c/.../.../public_html/wp-content/plugins/wp-views/application/models/shortcode/post/url.php on line 74

You can find it here: enlace oculto

All these notices appeared today when I opened the site. When I finished with the site on Friday, everything was clear.

#948322
s2018-07-16.png

Third problem:

I created a form to change a custom user field on submit ("Archive employee" form, it changes wpcf-employee-status to "archived").

The form is placed in a modal window and called from a view of users (see screenshot).

This is the code of the modal (part of the table):

<td class="center"><button type="button" class="btn bg_red btn-sm" data-toggle="modal" data-target="#id_[wpv-user field='ID']">Archive</button>
        <div class="modal fade" id="id_[wpv-user field='ID']" tabindex="-1" role="dialog" aria-labelledby="id_[wpv-user field='ID']_label">
          <div class="modal-dialog" role="document">
            <div class="modal-content">
              <div class="modal-body">
                <p>Are you sure you want to archive the employee [wpv-user field="user_firstname"] [wpv-user field="user_lastname"]?</p>
                <div class="buttons">
					[cred_user_form form='employee-archive' user="[wpv-user field='ID']"]
                  <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                </div>
              </div>
            </div>
          </div>
        </div>
</td>

Here is the code to change the employee status:

    if ($form_data['id']==2472) {
        update_user_meta($post_id, 'wpcf-employee-status', 'archived');
    }

The problem is that when I click the button "archive the employee" it just reloads the page and does not seem to change the employee status. But if the next thing I do is to refresh the page, I get "Confirm form resubmission" message, and if I agree, it does changes the employee status and the employee is now removed from the list.

You can see it in action here: enlace oculto

I'm not sure what I am doing wrong, as I already used this configuration for posts and everything worked fine.

Please advise. Thanks.

#948381

Hi Valeria,

The first two issues: These issues seem to be compatibility problems with another plugin/theme.

As we got many similar reports and by the end, we discover that the problem is with the time the themes/plugins register their post types.

So, please test if the issue exists while only Toolset plugins are active with a default theme and let me know the result.
I can do that but first, I will need your permission to do so.

About the last one, I'm not able to see the problem, I can click the button, and the user is being archived and I can't see the user after the first refresh. please let me know if I miss something.

Thanks.

#948431

Hi Mohammed,

Thank you for the reply.

About the third issue, you're right, it's working now. I'm not sure why it didn't work before, but I guess it's solved.

As for the first two, I have disabled all other plugins but Toolet's and installed Twenty Seventeen theme. I still see the same notices.

#948708

Hi Valeria,

Thank you for the testing.

The next step, to save some time, I will need to replicate the issue on my local machine to debug the issue.

Can you provide a downloading link to a copy of your website? you can use the duplicator plugin to prepare this copy.

I will set the next reply as a private one so that you can provide the downloading link securely.

Thanks.

#949012
#950098

Hi Mohammed,

How is it going? It's getting urgent here, how long is it going to take you to investigate the issue?

#950167

Hi again,

I just found out that the issue #3 still exists. If you try to archive the first employee in the list, it works fine. If you try to archive any other employee, it repeats what I described you earlier. It has nothing to do with the modal, because if I put the button (form) directly in the table cell, I have the same issue. I thought there is something wrong with the user IDs, but if I try to display them respectively, they are displayed correctly for every employee.

Please check it on your side from the duplicator package I gave you, as I'm removing it from the system until it's solved.

As I said, it's getting urgent here, so I would really appreciate a faster response.

Thank you for you help.

#951264

Hi Valeria,

I'm not able to login to your website as well as not able to download the package.

Can you please check the provided credentials and make sure that they work.

I will set the next reply as a private one as well.

Thanks.

#951306
#951472

Hi Valeria,

I'm currently downloading your website and will work on it once I install it.

Please keep following the ticket and I will notify you once I find anything.

Thanks.

#951528

Hi Valeria,

The first issue: inquiries/past-inquiries/

I understood from your setup that you have requests and customers post types.
The customer is connected to the request through the field (Related customer) . this field is filled in the request post.

You manually fill the (Related customer) field value to be the ID of the related customer.

In the View (Requests - Past) , you want to display the URL of the related customer using this shortcode: [wpv-post-url id="[types field=request-customer-id][/types]"]

The problem here is that some website admin filled the ID in this field wrongly. the errors are being shown for IDs in the related customer field for nonexistent customers.

So, you need to check these fields and correct them.

You can use the post relationships instead: https://toolset.com/documentation/post-relationships/

I will start working on the other issue ASAP.

Thanks.

#951530

Hi Valeria,

I'm able to archive the employees on my localhost and also on your website.

Please check this again and let me know if I miss anything.

I reverted their status back to current so that you can try it again.

Thanks.

#952132

Hi Mohammed,

Thank you for checking the things out.

Issue with Notice: I got it, thanks. Didn't think about that possible reason at all, will keep it in mind for the future.

Issue with the employees:

I recorded my screen to demonstrate the issue that I still have.

You'll see that when I try to refresh the page after unsuccessful archiving, it does not repeat the behavior I described you a few days ago. I could not replicate that behavior anymore. But at some moment I couldn't even archive the first employee in the list. None of them, as you'll see in one of the videos.

The only difference between two videos is that one is made in incognito mode. In case it has any significance, I'm using Yandex browser and I tried it in Mozilla with the same result. Windows.

You can find the videos here: enlace oculto

Thank you for looking into it.