Problem with Undefined index: td_action

Posted in: Newspaper
Post count: 20

Hi,
We bought the Newspaper theme 1 week ago and it is throwing this error from location below.
How do we fix this?
do_action(‘td_wp_booster_loaded’)
wp-content/themes/Newspaper/includes/wp_booster/td_wp_booster_functions.php:214
tdc_plugin_init()
wp-includes/class-wp-hook.php:286
load_css_live()
wp-content/plugins/td-composer/css-live/css-live.php:592
wp-content/plugins/td-composer/css-live/css-live.php:31

Post count: 20688

Hi,

Does it happen if you deactivate all non-theme plugins? Did you maybe make any modifications to the theme or added code in it’s files?

If the problem remains we could take a look. Send us admin login at contact@tagdiv.com also cPanel will be helpful if possible. Include a link to this topic in the email.

Thanks

Post count: 14

Hi Simion,

I’m getting the same error:
\td-composer\css-live\css-live.php

LINE 31: $get_action = @$_GET[‘td_action’];

Exception has occurred.
Notice: Undefined index: td_action

And my TablePress shortcodes aren’t working like they used to.

Post count: 14

Also, please explain why all the following is commented out from the file …\Newspaper\includes\plugins\td-composer\includes\tdc_main.php:

//// Add external shortcodes
//if ( tdc_state::is_live_editor_iframe() || tdc_state::is_live_editor_ajax() ) {
// register_external_shortcodes();
//
// // Change the callbacks of the shortcodes not registered in TagDiv Composer
// // Important! Here it’s too late to map these shortcodes, the mapping should be where the ‘$tdc_admin_settings’ is set (@see ‘admin_head’ action)
// add_filter( ‘the_content’, ‘tdc_on_the_content’ );
// function tdc_on_the_content( $content ) {
//
// $mappedShortcodes = tdc_mapper::get_mapped_shortcodes();
//
// //var_dump( $mappedShortcodes ); die;
//
// global $shortcode_tags;
//
// if (empty($shortcode_tags) || !is_array($shortcode_tags))
// return $content;
//
// // Find all registered tag names in $content.
// preg_match_all( ‘@\[([^<>&/\[\]\x00-\x20=]++)@’, $content, $matches );
// $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
//
// if ( empty( $tagnames ) ) {
// return $content;
// }
//
// foreach( $tagnames as $tagname ) {
// if ( ! array_key_exists( $tagname, $mappedShortcodes ) ) {
// add_shortcode( $tagname, ‘tdc_external_shortcode’ );
// }
// }
//
// global $vc_shortcodes;
//
// foreach( $vc_shortcodes as $vc_shortcode ) {
// add_shortcode( $vc_shortcode, ‘tdc_external_shortcode’ );
// }
//
// return $content;
// }
//}

//function tdc_map_not_registered_shortcodes($postId) {
// $currentPost = get_post($postId);
//
// $mappedShortcodes = tdc_mapper::get_mapped_shortcodes();
//
// //var_dump( $mappedShortcodes ); die;
//
// global $shortcode_tags;
//
// if (empty($shortcode_tags) || !is_array($shortcode_tags))
// return;
//
// // Find all registered tag names in $content.
// preg_match_all( ‘@\[([^<>&/\[\]\x00-\x20=]++)@’, $currentPost->post_content, $matches );
// $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
//
// if ( empty( $tagnames ) ) {
// return;
// }
//
// foreach( $tagnames as $tagname ) {
// if ( ! array_key_exists( $tagname, $mappedShortcodes ) ) {
// add_shortcode( $tagname, ‘tdc_external_shortcode’ );
// }
// }
//
// global $vc_shortcodes;
//
// foreach( $vc_shortcodes as $vc_shortcode ) {
// add_shortcode( $vc_shortcode, ‘tdc_external_shortcode’ );
// }
//}

[…]

//global $vc_shortcodes;
//
//$vc_shortcodes = array(
// ‘vc_btn’,
// ‘vc_icon’,
// ‘vc_tta_tabs’,
// ‘vc_tta_section’
//);
//
//
//
//function map_not_registered_shortcodes() {
//
// global $post;
//
// if (!isset($post)) {
// return;
// }
//
// $mappedShortcodes = tdc_mapper::get_mapped_shortcodes();
//
// //var_dump( $mappedShortcodes ); die;
//
// global $shortcode_tags;
//
// //var_dump($shortcode_tags); die;
//
// if (empty($shortcode_tags) || !is_array($shortcode_tags))
// return;
//
// // Find all registered tag names in $content.
// preg_match_all( ‘@\[([^<>&/\[\]\x00-\x20=]++)@’, $post->post_content, $matches );
// $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
//
// if ( empty( $tagnames ) ) {
// return;
// }
//
// foreach( $tagnames as $tagname ) {
// if ( ! array_key_exists( $tagname, $mappedShortcodes ) ) {
//
// tdc_mapper::map_shortcode(
// array(
// ‘map_in_visual_composer’ => true,
// ‘base’ => $tagname,
// ‘name’ => $tagname,
// ‘params’ => array(
// array(
// ‘type’ => ‘textfield’,
// ‘heading’ => ‘Extra class name’,
// ‘param_name’ => ‘el_class’,
// ‘description’ => ”,
// )
// )
// )
// );
// }
// }
//
// global $vc_shortcodes;
//
// foreach ($vc_shortcodes as $vc_shortcode) {
// tdc_mapper::map_shortcode(
// array(
// ‘map_in_visual_composer’ => true,
// ‘base’ => $vc_shortcode,
// ‘name’ => $vc_shortcode,
// ‘params’ => array(
// array(
// ‘type’ => ‘textfield’,
// ‘heading’ => ‘Extra class name’,
// ‘param_name’ => ‘el_class’,
// ‘description’ => ”,
// )
// )
// )
// );
// }
//}

/**
* edit with td composer
*/

Thank you.

Perhaps there are some admin settings I need to change to get shortcodes from excerpts to work on category pages, again.

Post count: 20688

Hi,


@charles
.kiss@gmail.com What version of the theme are you using? That code shouldn’t be commented like that, at least it is not for me in theme version 9.6, also I can’t find references for some of the code you mention in the composer, on my end. What if you reinstall the composer, does it work then?

Thanks

Post count: 14

Simion, thank you for your response.

Sorry for the ambiguity: The tdc_main.php file containing the comments “//// Add external shortcodes….” was taken from a version 8.5 directory I had archived, …\Newspaper\includes\plugins\td-composer\includes\tdc_main.php Line 231.

I grepped the current installation of version 9.5 and those comments are not found.

The irony is that the Newspaper 8.5 version worked fine in early January 2109 (and since we purchased the product in 2017): Shortcode in the excerpt field worked before the 2019 WordPress and PHP updates – I think up to WordPress 4.95, and PHP 7.0.32.

In any case, our TablePress shortcodes are no longer rendering properly on category pages (and haven’t since January):

https://ipq.org/category/warning-letters/

These shortcodes are added to the excerpt field in the post, such as (HTML brackets are stripped for clarity):

a href=”https://ipq.org/micro-labs-limited/”><font color=”000000″>[table id=217 /]</font></a

You can see by visiting the page that the shortcode text is linked, ie. being read.

I’ve not been able to have any shortcodes render under these conditions, not even old built-in WordPress shortcodes.

The Call Stack I’m getting from the td_action undefined index error is (edited for clarity):

load_css_live (…\plugins\td-composer\css-live\css-live.php:31)
require_once (…\plugins\td-composer\css-live\css-live.php:592)
tdc_plugin_init (…\plugins\td-composer\td-composer.php:68)
WP_Hook->apply_filters (…\wp-includes\class-wp-hook.php:286)
WP_Hook->do_action (…\wp-includes\class-wp-hook.php:310)
do_action (…\wp-includes\plugin.php:465)
require_once (…\Newspaper\includes\wp_booster\td_wp_booster_functions.php:214)
include (…\Newspaper\functions.php:44)
require_once (…\wp-settings.php:479)
require_once (…\wp-config.php:105)
require_once (…wp-load.php:37)
{main} (…\wp-admin\admin-ajax.php:22)

The code we used to deliver the hooks were – and currently are – added to the Newspaper/functions.php file, LINE 12:

add_filter(‘the_excerpt’, ‘shortcode_unautop’);
add_filter(‘the_excerpt’, ‘do_shortcode’);
add_filter(‘get_the_excerpt’, ‘do_shortcode’);

Please pardon me for any errors, including errors in communication, I’ve been working on this off-and-on since January. Many attempts were made to fix this problem, including: • new installations with the old Newspaper 8.5 theme • new installations with the new theme • deactivation and deletion of plugins, including combinations thereof, and • running on PHP 7.0.32 in a development environment.

Our ipq.org site is a development site, as is ipqpubs.org, where these problems first arose.

I just began the debugging process in Visual Studio Code, a few days ago. Your assistance is greatly appreciated. I’m sure the solution is a very simple one.

Thank you!

Post count: 20688

I can’t remember that working in older theme versions, maybe you have made modifications in order for it to work at the time. Something like this may work
https://forum.tagdiv.com/topic/rendering-shortcodes-in-the-manual-excerpt-field/

Post count: 14

That’s very funny Simion C. I can’t believe you dug that up, and IPQ didn’t find it – obviously that edit was overwritten during the upgrade and it wasn not in our notes! If I wasted your time, let me know if there is anything more I can do to support you and tagDiv.

[I’m going to have that edit tattooed onto my forehead!]

But why isn’t that line the default? Just curious.

Also, if you think it’s important, maybe we can work on that undefined index error on td_action – but it doesn’t appear critical, atm.

Post count: 20688

I could add this as a request, so that it will be implemented in the theme permanently. Absolutely no need to apologize or anything, I am glad that I could help you.

Regarding that error you are receiving, we could take a look. Please send us an email at contact@tagdiv.com and mention as many details about it as possible. We will try to identify why it is happening. Let us know.

Post count: 14

I have a two hour meeting in thirty minutes, and afterward I’ll put something together from XDebug/VS Code Editor on my IDE. Is there anything in particular I should report on?

Post count: 14

Thank you, Simion. I submitted an email with some details.

Viewing 11 posts - 1 through 11 (of 11 total)
The forum ‘Newspaper’ is closed to new topics and replies.