Welcome Guest, Not a member yet? Register   Sign In
  Ajax post failing with TypeError
Posted by: PaulC - Yesterday, 06:25 AM - Replies (3)

I have defined the route and when I actually fire the JS I end up with the following: (CI 4.6.0, on FireFox). Is this a CI problem please?
{
    "title": "TypeError",
    "type": "TypeError",
    "code": 500,
    "message": "CodeIgniter\\HTTP\\Request::fetchGlobal(): Argument #3 ($filter) must be of type ?int, true given, called in /var/www/html/gnb/ci460/system/HTTP/IncomingRequest.php on line 714",
    "file": "/var/www/html/gnb/ci460/system/HTTP/RequestTrait.php",
    "line": 258,
    "trace": [
        {
            "file": "/var/www/html/gnb/ci460/system/HTTP/IncomingRequest.php",
            "line": 714,
            "function": "fetchGlobal",
            "class": "CodeIgniter\\HTTP\\Request",
            "type": "->"
        },
        {
            "file": "/var/www/html/gnb/ci460/app/Controllers/TheBigPicture.php",
            "line": 148,
            "function": "getPost",
            "class": "CodeIgniter\\HTTP\\IncomingRequest",
            "type": "->"
        },
        {
            "file": "/var/www/html/gnb/ci460/system/CodeIgniter.php",
            "line": 933,
            "function": "interact",
            "class": "App\\Controllers\\TheBigPicture",
            "type": "->"
        },
        {
            "file": "/var/www/html/gnb/ci460/system/CodeIgniter.php",
            "line": 507,
            "function": "runController",
            "class": "CodeIgniter\\CodeIgniter",
            "type": "->"
        },
        {
            "file": "/var/www/html/gnb/ci460/system/CodeIgniter.php",
            "line": 354,
            "function": "handleRequest",
            "class": "CodeIgniter\\CodeIgniter",
            "type": "->"
        },
        {
            "file": "/var/www/html/gnb/ci460/system/Boot.php",
            "line": 334,
            "function": "run",
            "class": "CodeIgniter\\CodeIgniter",
            "type": "->"
        },
        {
            "file": "/var/www/html/gnb/ci460/system/Boot.php",
            "line": 67,
            "function": "runCodeIgniter",
            "class": "CodeIgniter\\Boot",
            "type": "::"
        },
        {
            "file": "/var/www/html/gnb/ci460/public/index.php",
            "line": 56,
            "function": "bootWeb",
            "class": "CodeIgniter\\Boot",
            "type": "::"
        }
    ]
}


Question Website Traffic Drop After Migrating to Magento 2.4.7?
Posted by: pmkkgems - Yesterday, 01:25 AM - Replies (1)

Hi everyone,

I recently upgraded my eCommerce website, PMKK Gems, from an older version of Magento to Magento 2.4.7. While the website is now running faster and smoother, I’ve noticed a big drop in organic traffic since the update.

We kept all the product data, design, and most of the URLs the same during the migration. Still, the drop in traffic is worrying. I think it might be due to some SEO settings, URL changes, redirects, or some missed configuration during the process.

Has anyone else faced the same issue after moving to Magento 2.4.7?
What are the most common SEO mistakes during a Magento migration that can cause traffic to drop?

I’d really appreciate any help or suggestions.
Thanks in advance!


  CI4 Auto-Discovery not working on dedicated server (cpanel)
Posted by: cypressit - 05-09-2025, 08:56 AM - Replies (1)

I am working on a prototype using Modules. Everything is working fine in xampp on my windows desktop. When I deploy it to my dedicated server, it cannot find the routes

Folder structure
app
     Config
         Autoload
         Routes
cits
     Blog
          Config
               Routes
          Controllers
               Blog

FILES:

app\Config\Routes
----------------------------------------------------------
service('auth')->routes($routes);
$routes->get('/', 'Home::index');


app\Config\Autoload
---------------------------------------------------------
public $psr4 = [
    APP_NAMESPACE => APPPATH,
    'Config' => APPPATH . 'Config',
    'Cits\Settings' => ROOTPATH . 'cits\Settings',
    'Cits\Blog' => ROOTPATH . 'cits\Blog',
];

\cits\Blog\Config\Routes
---------------------------------------------------------
$routes->group("blog", ["namespace" => "\Cits\Blog\Controllers"], function ($routes) {
    $routes->get("/", "Blog::index");
});
Error I receive:  Can't find a route for 'GET: blog'.

Any idea why this is not working.


  Why PHP is still worth learning in 2025:By the numbers
Posted by: php_rocs - 05-09-2025, 05:13 AM - Replies (1)

Excellent read (Dev.to): https://dev.to/dehemi_fabio/why-php-is-s...mbers-20mc


  My Library cannot see session
Posted by: PaulC - 05-08-2025, 09:18 AM - Replies (2)

Hi Team, (having resolved helper issue) the debugging show one of my libraries cannot see the session.
I have loaded the library (Template) and the session in the BaseController ie

PHP Code:
<?php

namespace App\Controllers;

use 
CodeIgniter\Controller;
use 
CodeIgniter\HTTP\CLIRequest;
use 
CodeIgniter\HTTP\IncomingRequest;
use 
CodeIgniter\HTTP\RequestInterface;
use 
CodeIgniter\HTTP\ResponseInterface;
use 
Psr\Log\LoggerInterface;

/**
* Class BaseController
*
* BaseController provides a convenient place for loading components
* and performing functions that are needed by all your controllers.
* Extend this class in any new controllers:
*    class Home extends BaseController
*
* For security be sure to declare any new methods as protected or private.
*/
abstract class BaseController extends Controller
{
    /**
    * Instance of the main Request object.
    *
    * @var CLIRequest|IncomingRequest
    */
    protected $request;

    /**
    * An array of helpers to be loaded automatically upon
    * class instantiation. These helpers will be available
    * to all other controllers that extend BaseController.
    *
    * @var list<string>
    */
    protected $helpers = ['url''form''functions''time''myvalidate''debug'];

    /**
    * Be sure to declare properties for any property fetch you initialized.
    * The creation of dynamic property is deprecated in PHP 8.2.
    */
    public $session;
public 
$db;
public 
$smail;
public 
$ajax;
public 
$template;
public 
$get;
public 
$make;
public 
$delete;

    /**
    * @return void
    */
    public function initController(RequestInterface $requestResponseInterface $responseLoggerInterface $logger)
    {
        // Do Not Edit This Line
        parent::initController($request$response$logger);

        // Preload any models, libraries, etc, here.

        $this->session = \Config\Services::session();
$this->db = \Config\Database::connect();

$this->smail = new \App\Libraries\Smail();
$this->ajax = new \App\Libraries\Ajax();
$this->template = new \App\Libraries\Template();
$this->get = new \App\Libraries\Get();
$this->make = new \App\Libraries\Make();
$this->delete = new \App\Libraries\Delete();

    }

My controller calls the Template lib which in turn tries to access the session.
I appreciate the libs do not extend BaseController, but I was hoping $this->template and $this->session would be available to everything.
I'm sorry but I appear to be in a morasse of object inheritance and am not sure what to do to fix this?
The error thrown is: Undefined property: App\Libraries\Template::$session
The code snippet from my Template lib is;
PHP Code:
public function render($name$admin false)
    {
        $ip_address real_ip();

        if (!$this->session->get('view_site') || is_ip_blocked($ip_address)) {
            return;
        
Any pointers appreciated, thx, Paul


  update the framework to the latest version
Posted by: Erepaing - 05-07-2025, 11:31 PM - Replies (1)

I am in the process of updating my CodeIgniter framework from version 4.1.3 to 4.1.4. The process requires me to update incrementally, step by step for each version. I initially attempted to use the "composer update" command, however, it only updated the libraries and not the framework itself. As a result, I am searching for a solution to effectively update the framework to the latest version.


  MVC vs MVCS vs CodeIgniter
Posted by: FlavioSuar - 05-07-2025, 01:58 PM - Replies (2)

Hi,
Reading this post Better than MVC.
What do you think? 
I saw some messages about using CI that way and makes sense to me...

Cheers.


  my controller fails to find helper function
Posted by: PaulC - 05-07-2025, 05:40 AM - Replies (12)

Hi Team,
I love the new error interface - great job!
Its helping me to upgrade my ci3 to ci 4.6.0
Latest snag is my controller which extends BaseController cannot find the validation function:
- the function is 'is_valid_level' which is defined in a Helper myvalidate_helper.php
- the myvalidate helper is loaded (I think) by adding to the $helpers array in the BaseController (I can see it in the list of files).
- ci3 call was

PHP Code:
if (!is_valid_level($level3)) { .... 
- and I changed it to after a bit of research
PHP Code:
if (!myvalidate(is_valid_level($level3))) { .... 
- and the error reported is: Call to undefined function App\Controllers\myvalidate()
Clearly I have misunderstood something important, so could someone explain what I have got wrong please?
Thx Paul


  Update to 4.6.1
Posted by: serialkiller - 05-07-2025, 01:33 AM - Replies (12)

I'm updating some applications and one of the files that has changed is Config/Paths.php.
Compared to the previous one, it has a different value for the $systemDirectory variable, before it was:

PHP Code:
public string $systemDirectory __DIR__ '/../../vendor/codeigniter4/framework/system'


now instead I find:

PHP Code:
public string $systemDirectory __DIR__ '/../../system'


But this will never work, the system folder is not located there.

Am I doing something wrong?


  systemDirectory conundrum
Posted by: codeus - 05-06-2025, 06:48 AM - Replies (2)

Hi all,
Just did a test install of CI v4.6.1 with composer. All worked fine and dandy.

I noticed that in app/Config/Paths the $systemDirectory is:

PHP Code:
    public string $systemDirectory __DIR__ '/../../vendor/codeigniter4/framework/system'


I'm sure that in v4.5 (and earlier) $systemDirectory was
PHP Code:
public string $systemDirectory __DIR__ '/../../system'

and that for every install I would have to edit this to _DIR__ . '/../../vendor/codeigniter4/framework/system' in Paths.php

Was this a bug? I'm curious because I've just seen a v4.4.0 installation (not mine) with system directory at the same level as app.

Don't know why system directory would be at the same level as app. Was this for a non-composer install??

TIA
Mike


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Ajax post failing with Ty...
by vitnibel
7 hours ago
MVC vs MVCS vs CodeIgnite...
by FlavioSuar
Yesterday, 10:33 AM
CodeIgniter Shield 1.0.0 ...
by timesprayer
Yesterday, 05:22 AM
Website Traffic Drop Afte...
by InsiteFX
Yesterday, 04:23 AM
Magic login link not work...
by InsiteFX
Yesterday, 04:16 AM
Is codeigniter 5 upco...
by InsiteFX
Yesterday, 04:10 AM
CI4 Auto-Discovery not wo...
by InsiteFX
05-09-2025, 11:04 PM
Why PHP is still worth le...
by InsiteFX
05-09-2025, 10:55 PM
Any user guid or video o...
by msnisha
05-09-2025, 02:30 PM
Why Every Programmer Need...
by Yetkiliteknikservis
05-09-2025, 01:49 PM

Forum Statistics
» Members: 145,234
» Latest member: shuddhiclinics
» Forum threads: 78,385
» Forum posts: 379,434

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB