google chart – Uncaught TypeError: Cannot read property ‘results’ of null – when reading SharePoint list with JS

I am using an ajax call to get elements of multiple sharepoint list choice(checkboxes) columns called “Orbit”, “SD”,…. to create google pie charts for each column:

data.d.results.forEach(function(row) {
    // each row
    row.Orbit.results.forEach(function(choiceOrbit) {
        // each choice of Orbit of single row
        if (countOrbit.hasOwnProperty(choiceOrbit)) {
            countOrbit(choiceOrbit) += 1;
        } else {
            countOrbit(choiceOrbit) = 1;
        }
    });

But if one row in the column is empty, I get an error:

Uncaught TypeError: Cannot read property 'results' of null
at Statistics.aspx:658
at Array.forEach (<anonymous>)
at Object.success (Statistics.aspx:632)
at i (jquery.min.js:2)
at Object.fireWith (as resolveWith) (jquery.min.js:2)
at A (jquery.min.js:4)
at XMLHttpRequest.<anonymous> (jquery.min.js:4)

How can i add an if(), so that an empty item will be neglected in the counting? Something like:

if(row.Orbit.results.forEach!=null)

or

 if(data.d.results.length > 0)
  {
    // Add your code

  }

or

if(row!=null)

doesnt work

EDIT: my full code is:

<html>
<head>

<script src="https://www.gstatic.com/charts/loader.js" type="text/javaScript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js" type="text/javaScript"></script>
<script type="text/javaScript">
    $(document).ready(function () {
    var tempArray = ();
    var chartObj = (('Orbit', 'Number'));

AjaxCall(_spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('list')/items", function (data) {

    var countOrbit = {};
    var countSD = {}; 
    var countMT = {}; 
    var countIT = {}; 
    var countAI = {}; 


    data.d.results.forEach(function(row) {
        // each row
        row.Orbit.results.forEach(function(choiceOrbit) {
            // each choice of Orbit of single row
            if (countOrbit.hasOwnProperty(choiceOrbit)) {
                countOrbit(choiceOrbit) += 1;
            } else {
                countOrbit(choiceOrbit) = 1;
            }
        });
        row.SD.results.forEach(function(choiceSD) {
            // each choice of Orbit of single row
            if (countSD.hasOwnProperty(choiceSD)) {
                countSD(choiceSD) += 1;
            } else {
                countSD(choiceSD) = 1;
            }
        });
        row.MT.results.forEach(function(choiceMT) {
            // each choice of MT of single row
            if (countMT.hasOwnProperty(choiceMT)) {
                countMT(choiceMT) += 1;
            } else {
                countMT(choiceMT) = 1;
            }
        });
        row.IT.results.forEach(function(choiceIT) {
            // each choice of IT of single row
            if (countIT.hasOwnProperty(choiceIT)) {
                countIT(choiceIT) += 1;
            } else {
                countIT(choiceIT) = 1;
            }
        });
        row.AI.results.forEach(function(choiceAI) {
            // each choice of IT of single row
            if (countAI.hasOwnProperty(choiceAI)) {
                countAI(choiceAI) += 1;
            } else {
                countAI(choiceAI) = 1;
            }
        });
    });

    // Load Charts and the corechart package.
    google.charts.load('current', {packages:('corechart')});
    google.charts.setOnLoadCallback(function(){drawAllCharts(countOrbit, 'Orbit')});
    google.charts.setOnLoadCallback(function(){drawAllCharts(countSD, 'SD')});
    google.charts.setOnLoadCallback(function(){drawAllCharts(countMT, 'MT')});
    google.charts.setOnLoadCallback(function(){drawAllCharts(countIT, 'IT')});
    google.charts.setOnLoadCallback(function(){drawAllCharts(countAI, 'AI')});


    // Function for all Charts

    function drawAllCharts(countChoices, name) {
        var rows = ();
        for (var property in countChoices) {
            if (countChoices.hasOwnProperty(property)) {
                rows.push((property, countChoices(property)));
            }
        }


        var datatable = new google.visualization.DataTable();
        datatable.addColumn('string', 'Type');
        datatable.addColumn('number', 'Quantity');
        datatable.addRows(rows);
        var options = {
            title: String(name),
            is3D: 'true'
        };
        var chart = new google.visualization.PieChart(document.getElementById(String(name)));
        chart.draw(datatable, options);
    }
    // End of function to draw charts


});
});
                function AjaxCall(url, success) {
                    $.ajax({
                        url: url,
                        type: "GET",
                        headers: {
                            "accept": "application/json;odata=verbose",
                        },
                        success: success,
                        error: function (error) {
                            console.log(JSON.stringify(error));
                            alert('Something Went Wrong');
                        }
                    });
                }
</script>
</head>
  <body>
    <!--Table and divs that hold the pie charts-->
    <table class="columns">
      <tr>
        <td><div id="Orbit" style="width:700px;height:500px;"></div></td>
        <td><div id="SD" style="width:700px;height:500px;"></div></td>
      </tr>
      <tr>
        <td><div id="MT" style="width:700px;height:500px;"></div></td>
        <td><div id="IT" style="width:700px;height:500px;"></div></td>
        <td><div id="AI" style="width:700px;height:500px;"></div></td>
      </tr>
    </table>
  </body>
</html>

magento2 – Common Javascript Errors for Magento 2.3.7 Uncaught SyntaxError

This is an error where some of the code is deprected but can be fixed. It is the #porto 3.23 version for Magento 2.3.7 Hoping someone with some experience can help me in this one. VM10437:14 Uncaught SyntaxError: Unexpected token , in JSON at position 1482

 at getNodeData (scripts.min.js:5)
 at Array.map (<anonymous>)
 at scripts.min.js:6
 at HTMLDocument.apply (main.min.js:5)
 at fire (jquery.min.js:212)
 at Object.add (as done) (jquery.min.js:215)
 at jQuery.fn.init.jQuery.fn.ready (jquery.min.js:223)
 at jQuery.fn.init (jquery.min.js:200)
 at new jQuery.fn.init (jquery-migrate.min.js:27)```

symfony services – How to find the cause of “Uncaught PHP Exception”

When I go to any page, the following error appears in the log:

[proxy_fcgi:error] [pid 20333] [client 172.18.0.6:52608] AH01071: Got error 'PHP message:
 Uncaught PHP Exception Symfony\Component\Routing\Exception\MethodNotAllowedException:
 "" at /var/www/html/web/core/lib/Drupal/Core/Routing/MethodFilter.php line 46', referer: 
 http://example.dk.ddev.site/da

At first I thought it had something to do with my new theme that I am about to make. But if I change theme, the error is still there. I am using Drupal v9.2.5.

How do I track down the cause of the error?

javascript – Uncaught TypeError: Cannot set property ‘innerHTML’ of null at XMLHttpRequest

Tengo un código para que desde un input select, al seleccionar una opción traiga desde la BD ciertos datos con XMLHttpRequest, sin embargo me esta arrojando el siguiente error justo cuando selecciono una opción del select:

introducir la descripción de la imagen aquí

El fragmento de código de JS es:

<script type="text/javascript">
    function mostrarDatosPsicologo(str){
        if (str==""){
            document.getElementById("txtHint").innerHTML= "";
            return;
        }
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange=function(){
            if(this.readyState==4 && this.status==200){
                document.getElementById("txtHint").innerHTML=this.responseText;
            }
        }
        
        xmlhttp.open("GET", "../procesos/sesiones/obtenerDatosPsicologo.php?q="+str,true);
        xmlhttp.send();
    }

    //setInterval(function(){mostrarDatosPsicologo();}, 1000);
</script>

El fragmento de código del elemento HTML es:

<div class="row justfy-content-center">
                                <div class="col-sm-4">

                                </div>
                                <div class="col-sm-4 text-center">
                                    <hr>
                                    <label for="psicologo_asignado">Datos del Psicologo asignado</label>
                                    <br>
                                </div>
                            </div>
                            <div class="row">
                                <div class="txtHint"> </div>
                            </div>
                            <hr>

Esto último dentro de un FORM con method="POST", no se si ese sea el error solo que no puedo sacarlo del FORM.

De igual manera comparto el archivo obtenerDatosPsicologo.php:

<!DOCTYPE html>
<html>
<head>

<link rel="stylesheet" href="http://es.stackoverflow.com/public/datatable/dataTables.bootstrap4.min.css">
<link rel="stylesheet" href="http://es.stackoverflow.com/public/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="http://es.stackoverflow.com/public/datatable/responsive.bootstrap4.min.css">

</head>
<body>
    <?php
    $q=intval($_GET('q'));
    include "../../clases/Conexion.php";
    $con = new Conexion();
    $conexion = $con->conectar();

    if(!$conexion){
        die('No se pudo conectar al servidor: ' . mysqli_error($conexion));
    }
    $sql1= "SELECT 
                id_usuario,
                primer_nombre,
                segundo_nombre,
                apellido_paterno,
                apellido_materno
            FROM
                usuarios
            WHERE
                id = '".$q"'";
    $respuesta1 = mysqli_query($conexion, $sql1);

        echo "<table>
                <tr>
                    <th>Primer Nombre</th>
                    <th>Segundo Nombre</th>
                    <th>Apellido Paterno</th>
                    <th>Apellido Materno</th>
                </tr>";
        while($row= mysqli_fetch_array($respuesta1)){
        echo "<tr>";
        echo "<td>" . $row('primer_nombre') . "</td>";
        echo "<td>" . $row('segundo_nombre') . "</td>";
        echo "<td>" . $row('apellido_paterno') . "</td>";
        echo "<td>" . $row('apellido_materno') . "</td>";
        echo "</tr>";
        }

echo "</table>";

?>

<script src="https://es.stackoverflow.com/public/bootstrap/bootstrap.min.js"></script>
</body>
</html>

La base de datos si tiene los datos y celdas correctamente ya lo verifiqué, también intente mandar mas echo con algunas validaciones dentro del archivo PHP sin embargo el resultado era el mismo.

El setInterval lo puse para hacer una prueba y el error se actualizaba cada segundo, como especifique en el código, solo que no tengo idea si es un error desde JS o cometí algún error en el PHP y no envía los datos correctamente.
Los códigos de JS y PHP los obtuve de W3Schools, seguí las indicaciones que daban.

9 – Uncaught TypeError: value.autocomplete is not a function

After upgrading to Drupal 9 the console gives this error.

Uncaught TypeError: value.autocomplete is not a function 
attach https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:5229
    each https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:2
    attach https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:5208
    attachBehaviors https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:161
    attachBehaviors https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:158
    <anonymous> https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:387
    listener https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:375

As far as I can see, the search autocomplete doesn’t work anymore. This used to be working fine with module https://www.drupal.org/project/search_autocomplete. While upgrading I installed the latest version that should be compatible with Drupal 9.

There are a lot of hints that I could Google about “Uncaught TypeError: …. is not a function”, but I’m at a loss how to approach and solve this specific error.

I hope someone can give practical advise to solve this? Thanks.

Uncaught TypeError: value.autocomplete is not a function after upgrading to Drupal 9

After upgrading to Drupal 9 the console gives the error

Uncaught TypeError: value.autocomplete is not a function 
attach https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:5229
    each https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:2
    attach https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:5208
    attachBehaviors https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:161
    attachBehaviors https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:158
    <anonymous> https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:387
    listener https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:375

As far as I can see, the search autocomplete doesn’t work anymore. This used to be working fine with module https://www.drupal.org/project/search_autocomplete. While upgrading I installed the latest version that should be compatible with Drupal 9.

There are a lot of hints that I could Google about “Uncaught TypeError: …. is not a function”, but I’m at a loss how to approach and solve this specific error.

I hope someone can give practical advise to solve this? Thanks.

jquery – Como solucionar “Uncaught TypeError: $(…) is not a function”

jquery – Como solucionar “Uncaught TypeError: $(…) is not a function” – Stack Overflow en español

nginx – Ngnix + django +nodejs : Uncaught SyntaxError: Unexpected token ‘

This is first time using nginx and nodejs. I have two apps one is built using django and other is built using nodejs (expressjs +openvidu). I am trying to configure nginx, django app works fine, I am having trouble with nodejs. nginx is not serving js files. I am getting the below error in console, both of my js files present under public folder.

Uncaught SyntaxError: Unexpected token ‘<‘

Could you also suggest me if this is not the proper way to deploy django and nodejs

Below is my nginx configuration. /meeting is the node app.

 server {

  server_name sophie.ovgu.de;

  location /meeting {
    proxy_pass https://localhost:5000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
   }
  location /videoapp {
    proxy_pass http://unix:/run/gunicorn.sock;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
   }


    listen (::):443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/sophie.ovgu.de/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/sophie.ovgu.de/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    if ($host = sophie.ovgu.de) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


  listen 80;
  listen (::):80;

  server_name sophie.ovgu.de;
    return 404; # managed by Certbot


}

Please note “proxy_pass https://localhost:5000” this should be https as openvidu server requires it. Please refer this link

This is my folder structure

├───node_modules
├───public
│     app.js
│     openvidu-browser-2.18.0.js   
│───views
        index.ejs
│   openviducert.pem
│   openvidukey.pem
│   package-lock.json
│   package.json
│   README.md
│   server.js

admin – Fatal error: Uncaught Error: Class ‘Mage_Akhil_News_Helper_Data’ not found in C:xampphtdocsmagentoappMage.php:550

Magento newbie here, learning the platform by following a tutorial. I use magento 1.9.3.2. I have looked at all other posts relating this problem and yet it persists. I’m creating a simple menu in admin panel and get the error above. Here’s some code:
appetcmodulesAkhil_News.xml

<?xml version="1.0"?>
    <config>
    <modules>
      <Akhil_News>
        <active>true</active>
        <codePool>local</codePool>
      </Akhil_News>
    </modules>
</config>

And config.xml in appcodelocalAkhilNewsetc

<?xml version="1.0"?>
<config>
    <modules>
        <Akhil_News>
            <version>0.0.1</version>
        </Akhil_News>
    </modules>
    <global>
        <helpers>
            <news>
                <class>Akhil_News_Helper</class>
            </news>
        </helpers>
        <resources>
            <news_setup>
                <setup>
                    <module>Akhil_News</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </news_setup>
            <news_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </news_write>
            <news_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </news_read>
        </resources>
    </global>
</config>

The admin html in appcodelocalAkhilNewsetc

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <menu>
        <news module="akhil_news" >
            <title>News</title>
            <sort_order>100</sort_order>
            <children>
                <managenews module="akhil_news">
                    <title>Manage News</title>
                    <sort_order>90</sort_order>
                    <action>admin_news/adminhtml_news</action>
                </managenews>
            </children>
        </news>
    </menu>
</config>

And finally the helper class appcodelocalAkhilNewsHelperData.php

 <?php
    
     class Akhil_News_Helper_Data extends Mage_Core_Helper_Abstract
     {
        
     }
?> 

These files should give me a menu with no functionality in admin panel. However the entire admin is throwing this error. I have looked at other posts and,
1.Compilation is disabled
2.Cleared the cache multiple times
3.Most other posts solutions were closing tags or naming of the class.

If I set in appetcmodulesAkhil_News.xml the module to false, I get a normal page load so I believe the mistakes is in one of the config files but I’m unable to find it so far.

2013 – Uncaught Typeerror: b.toLowerCase is not a function

I’m using SPServices and cannot figure out why I keep getting this error thrown from the jQuery library that b.toLowercase is not a function. Here are complete details of the error:

jquery-1.11.3.min.js:2 Uncaught TypeError: b.toLowerCase is not a function
 at Function.ga.attr (jquery-1.11.3.min.js:2)
 at attr (jquery-1.11.3.min.js:5) 
at m.access (jquery-1.11.3.min.js:4) 
at m.fn.init.attr (jquery-1.11.3.min.js:5) at Element.<anonymous> (https://STandardization_copy(1).aspx:732:16) at Function.each (jquery-1.11.3.min.js:2) at m.fn.init.each (jquery-1.11.3.min.js:2) at Object.completefunc (https://STandardization_copy(1).aspx:731:46) at Object.complete (jquery.SPServices-2014.02.min.js:19) at j (jquery-1.11.3.min.js:2)
ga.attr @   jquery-1.11.3.min.js:2
attr    @   jquery-1.11.3.min.js:5
m.access    @   jquery-1.11.3.min.js:4
attr    @   jquery-1.11.3.min.js:5
(anonymous) @   PMSTandardization_copy(1).aspx:732
each    @   jquery-1.11.3.min.js:2
each    @   jquery-1.11.3.min.js:2
completefunc    @   PMSTandardization_copy(1).aspx:731
complete    @   jquery.SPServices-2014.02.min.js:19
j   @   jquery-1.11.3.min.js:2
fireWith    @   jquery-1.11.3.min.js:2
x   @   jquery-1.11.3.min.js:5
b   @   jquery-1.11.3.min.js:5
send    @   jquery-1.11.3.min.js:5
ajax    @   jquery-1.11.3.min.js:5
ao.fn.SPServices    @   jquery.SPServices-2014.02.min.js:19
(anonymous) @   STandardization_copy(1).aspx:724
j   @   jquery-1.11.3.min.js:2
fireWith    @   jquery-1.11.3.min.js:2
ready   @   jquery-1.11.3.min.js:2
J   @   jquery-1.11.3.min.js:2

Here is my code. I’m using a CEWP that links to an html file containing all of the code:

$().SPServices({
            operation: "GetListItems",
            async: false,
            CAMLViewFields: "<ViewFields><FieldRef Name='ID' /><FieldRef Name='docLink' /></ViewFields>",
            listName: "PM",
            debug: true,
            completefunc: function (xData, Status) {
                            $(xData.responseXML).SPFilterNode("z:row").each(function(){
                                            if ($(this).attr("docLink" === 2)){
                                            setTimeout(function(){
                                            location.relod(true);
                                            },3000);
                                            }
                            });
              }

            });

DreamProxies - Cheapest USA Elite Private Proxies 100 Cheapest USA Private Proxies Buy 200 Cheap USA Private Proxies 400 Best Private Proxies Cheap 1000 USA Private Proxies 2000 USA Private Proxies 5000 Cheap USA Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive.com Proxies-free.com New Proxy Lists Every Day Proxies123.com Proxyti.com Buy Quality Private Proxies