magento 1.9 – Fatal Error : Uncaught Error: Call to a member function getPdf()

I am getting the following error

Fatal error: Uncaught Error: Call to a member function getPdf() on bool in /var/www/html/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php:119 Stack trace: #0 /var/www/html/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php(489): Mage_Adminhtml_Controller_Sales_Invoice->printAction() #1 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(437): Mage_Adminhtml_Sales_Order_InvoiceController->printAction() #2 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(262): Mage_Core_Controller_Varien_Action->dispatch(‘print’) #3 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(192): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) #4 /var/www/html/app/code/core/Mage/Core/Model/App.php(381): Mage_Core_Controller_Varien_Front->dispatch() #5 /var/www/html/app/Mage.php(729): Mage_Core_Model_App->run(Array) #6 /var/www/html/index.php(80): Mage::run(‘default’, ‘store’) #7 {main} thrown in /var/www/html/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php on line 119

php – how to call jquery form submit function in javascript time end?

<script>
<?php
$start=$_SESSION('quiz');
$end=date('Y-m-d H:i:s', strtotime( $_SESSION('quiz') . ' + '. $total_time.' minutes' ) );
                echo "
                    var date_quiz_start='$start';
                    var date_quiz_end='$end';
                    var time_quiz_end=new Date('$end').getTime();";
?>

document.addEventListener('DOMContentLoaded', function(){
(function(time){
var now=new Date().getTime();
var difference = time_quiz_end - now;
var days = Math.floor(difference / (1000 * 60 * 60 * 24));
var hours = Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((difference % (1000 * 60)) / 1000);


t=setTimeout( arguments.callee, time );
if( difference <= 0 ){
clearTimeout( t );
        
// I want to call jquery form submit function here //
        
document.getElementById("timeoversc").style.display = "block";

//alert('Your Time has been Over!');
//window.close();
//return false;
}
document.getElementById("starttime").innerHTML=date_quiz_start;
document.getElementById("endtime").innerHTML=date_quiz_end;
document.getElementById("showtime").innerHTML = minutes + "m " + seconds + "s ";
})(1000);
},false );
</script>

Below is the form submit code which submits current visible form data as i used dynamic forms from database so. is anyone help me out its so urgent… basically i want to submit visible form data from javascript timeup function to get current time in database for that question, its online exam portal so.

<script>
$(document).ready(function () {
    $(".form").submit(function(e) {
        var theForm = $(this);
        var btn = document.activeElement.getAttribute('value');
        var quid = $(this).find("input#quid").val();
        var atid = $(this).find("input#atid").val();
        var srid = $(this).find("input#srid").val();
        var sid = $(this).find("input#sid").val();
        var gans = $(this).find("input.gans:checked").val();
        var dataString = 'quid='+ quid + '&atid=' + atid + '&srid=' + srid + '&sid=' + sid + '&gans=' + gans + '&section_id=<?php echo $section_id; ?>';
        
        if(btn=="Save & Next") {
            var Url = "jajaxp.php?sToreExam=true";
            var nextsrid = +srid +1;
        } else if(btn=="Mark for Review & Next") {
            var Url = "jajaxp.php?sToreReview=true";
            var nextsrid = +srid +1;
        } else if(btn=="Clear Response") {
            var Url = "jajaxp.php?clearResponse=true";
            $(this).find("input:radio(name='gans')").each(function(i) {
             this.checked = false;
            });
            var nextsrid = srid;
        }
        
  //alert (dataString);
  $.ajax({
    type: "POST",
    url: Url,
    data: dataString, // changed
    success: function(response) {
    $('#hideShow'+srid).addClass('hideShow').hide();
    $('#hideShow'+nextsrid).removeClass('hideShow').show();
    result = $(response).filter("#showsctnans");
    $('#shosctnans').html(result);
    resulta = $(response).filter("#ajxqsnsmry");
    $('#qsnsmry').html(resulta);
    resultan = $(response).filter("#nxtsctnsnsmry");
    $('#nxtscsmy').html(resultan);
    resultanai = $(response).filter("#nxtsctnsnsmry");
    $('#nxtscsmyi').html(resultanai);
    }
  });
  return false;  
  });
});    
</script>

Telephone call on hold feature in Wired technology

Is this feature possible in wired telephone voice calls technology (Digital and Analog exchanges) similar to Wireless technology in Smartphones on keeping a phone call on hold and then speaking with another person on call?

If Not, Why?enter image description hereenter image description here

How to implement call in?

In GooGLE Meet or in Zoom we can call in on a phone number and then enter a code to get audio.Want to implement the same .How can it be done? Python preferably but javascript or c++ will also do.Java for Android may be used.

magento2 – Magento 2 : How to call phtml file in helper?

I got asnwer of how to call it in Magento 1, but in M2 i am getting an error.

if($product->getTest()){
        $productid = $product->getId();
        return Mage::app()->getLayout()->createBlock('core/template')->setTemplate('demo/test/test.phtml');
    }

Please Help.

java – How can I apply an Optional in which I want to call a method?

I have this piece of code:

final ResultDO response = transformJsonToResponseDO(rawDataResponse, ResultDO.class);

return Optional.ofNullable(response)
            .map(results -> createPOIs(Collections.singletonList(response), providerResponse))
            .orElse(Collections.emptyList());

The important part is that: response is an object of type ResultDO. Within an Optional I want to call that method createPois(). Methot createPois wants a list of ResultDO, but there I will always have it only element because of that I wrapped in a Collections.singletonList().

As I wrote it, is it the right way, with that .map() ?

I don’t want to use if(response != null) …

Maybe it is worth to mention that createPois() return a list of some other types. A list of Points.

android 10 – How do I disable emergency call after three power button clicks on my Samsung S10?

I’m using a Samsung Galaxy S10 (on Android 10). One of the features that constantly irritates me is the accidental dialling of the emergency number. The system by-default looks for triple power button tap and automatically dials the emergency number (112). I read on XDA here that this is a feature specific to India and Indian SIMs, and I also bought this in India and used an Indian SIM for a short while during my stay there, but have since switched with no effect on the issue. Other regional users, per some threads of Samsung subreddit and Samsung forums, do not have this problem.

How do I change this behaviour? I’m looking to prevent emergency number dial on triple power button tap, and if possible, please provide a non-root based solution. I am willing to install Magisk, but only if there is a definite solution, and no alternative, as it adds another layer of complication. Thank you!

php – How to create a clickable static call us button that links to a new setting in general

I recently had an admin setting created on my website that allows me to input a contact number to display on the front end via a shortcode.

Now I am now trying to use this field to also create a clickable and static call button for mobile devices only that appears on the bottom of their screens.

There are plugins like WP Call Button that achieve this, but I am trying to keep my website as light as possible. Any help would be much appreciated!

I think I may need another 2 admin fields created that act as a text label as well as the hyperlink function? e.g. tel:035555555?

enter image description here

Here’s the code that was created (thanks again Walter) for my general settings:

/**
 * Class for adding a new field to the options-general.php page
 */
class Add_Settings_Field {

    /**
     * Class constructor
     */
    public function __construct() {
        add_action( 'admin_init' , array( $this , 'register_fields' ) );
    }

    /**
     * Add new fields to wp-admin/options-general.php page
     */
    public function register_fields() {
        register_setting( 'general', 'phone_number_custom', 'esc_attr' );
        add_settings_field(
            'custom_phone_number',
            '<label for="custom_phone_number">' . __( 'Phone Number' , 'phone_number_custom' ) . '</label>',
            array( $this, 'fields_html' ),
            'general'
        );
    }

    /**
     * HTML for extra settings
     */
    public function fields_html() {
        $value = get_option( 'phone_number_custom', '' );
        echo '<input type="text" id="custom_phone_number" name="phone_number_custom" value="' . esc_attr( $value ) . '" />';
    }

}
new Add_Settings_Field();

How to create shortcodes that pull custom field data from general settings

Speed-up REST API call for client residing on a local network

I have a REST API server and client (both on Docker containers, if that matters) residing on the same local network. Each HTTP call to the API takes 500ms to 1 second. This is acceptable however as soon as the client makes 3 or more API requests for a single action, the slowness becomes noticeable. This is using local IP as endpoint btw.

Given that both client and API is just “local”, is there a way to speed this up (aside from client-side caching)?

python – How to use regex in an API call for coinapi.io?

I would like to obtain the trading volume of bitcoin over all exchanges via coinapi.io. According to https://docs.coinapi.io/#security-list-request-x, it seems that I can obtain the trading between any asset with bitcoin with just two API call (since there is an API call limit of 100 per 24 hours).

This is from the website:

Exact match or regex for the symbol identifier filtering, eg. ^BITSTAMP_(.*)_USD$ or BITSTAMP_SPOT_BTC_USD, have in mind that regex is enabled only if value string starts with ^ or/and ends with $.

Therefore the 2 URL I thought would work is:

https://rest.coinapi.io/v1/ohlcv/^(.*)_(.*)_BTC$/history?period_id=1DAY&time_start=2017-01-01T00:00:00

https://rest.coinapi.io/v1/ohlcv/^(.*)_BTC_(.*)$/history?period_id=1DAY&time_start=2017-01-01T00:00:00

However, I only got this error for the first API call: “error”: “Requested symbol_id is invalid does not exists.”

I also tried with “^BITSTAMP_(.*)_USD$” from the documentation, same error.

Then I put the sign “$” at the end of the url instead of the original position: I got this error (it seems that “$” is considered as a part of the value for time):

  "error": "Wrong format of time_start parameter"

So does anyone know how to use regex in API-call of coinapi.io?

I am using python for the API call.