Autoblog Feeds not getting created

Once a feed is created it gives the following message:
"The feed has been created successfully.", but the feeds page is still empty.

The plugin is network enabled, performed Plugin conflict test, ie disabled all the network activated plugin, and also the plugins in the main site, still the same issue. Enabled debug mode, but it isn't generating any log files, which is really odd. Trying to make this work in the main site. Not able to replicate such an issue in other system.

  • Katya Tsihotska

    Hi bmetforlife

    I hope you had a great day!

    I've investigated your site and found that all feeds are successfully added to your database, but they have no site_id, that's why they are not displayed in your feeds list. I tried to manually add correct site_id to the first of them and it appears in feeds list, you can check it yourself.

    However, I can't find the cause of this issue, so I'm going to need to ping our SLS team (code experts) and get their valuable feedback on this. Since this is a bit more of an advanced query, it may take a little bit longer to get a reply back about this, but one of us will post back with feedback as soon as possible.

    If you have any additional questions please let me know and I’ll be happy to help.

    Kind regards,
    Katya

  • Lindeni Mahlalela

    Hi bmetforlife

    I hope you are doing great today. Thank you for contacting us and for reporting this issue to us.

    I have investigated the cause for this issue and have found a workaround and patched your the plugin on your website. Basically, the issue is with the structure of the table that stores the Autoblog feeds, it was designed to have a default value of 1 for the site_id column.

    If a default value is specified then the database server will automatically insert it in the column if no value has been provided. As my colleague Katya outlined above, the value is inserted as a NULL as seen in the screenshot which means the table structure is no longer as it was designed to be. I don't know any reasons that may cause the table definition to be altered in such way.

    I looked in the code and found that it does not pass a value for the site_id because it is assumed the default value will be used. Now, since the table is not as it should be, then the default value is then set to NULL which is then inserted in the site_id column.

    I have then modified the code a little to provide a value for the site_id so that it is passed in code instead of assuming the default. I have modified the file:

    autoblog/autoblogincludes/classes/Autoblog/Module/Page/Feeds.php

    I have modified the _save_feed() function as follows.

    private function _save_feed( $feed ) {
    	check_admin_referer( 'autoblog_feeds' );
    
    	$post = $_POST['abtble'];
    	//original code
    	$result = 'false';
    	if ( isset( $feed['feed_id'] ) ) {
    		$action = 'updated';
    		//original code
    	} else {
    		//Added: check if site_id is set, then set it if not already set
    		if ( !isset( $feed['site_id'] ) ) {
    			$feed['site_id'] = defined('SITE_ID_CURRENT_SITE') ? SITE_ID_CURRENT_SITE : 1;
    		}
    		//orginal code
    	}
    	//original code
    	exit;
    }

    Please note:

    //original code
    Means those lines of code have not changed.

    I have already done this on your website so that you will not have to do it again. Please keep in mind that this is not a final solution and has not yet been classified as a bug because the code works as it should if the database table is as it was designed to be.

    What I would suggest is that you check the database table named '<prefix>_autoblog', modify it and set the default for 'site_id' to 1. This will ensure that the plugin continues to work even if you loose the changes I have made on the code. This should be easy in phpMyadmin, just login to phpMyadmin,

    1. Choose the database on the left,
    2. Choose the '_autoblog' table for the main site, then once the table data is loaded,
    3. Go to 'Structure' table and click the 'Change' link corresponding to the 'site_id',
    4. Then specify the 'Default' like in the screenshot below:

    5. Click "Save" and check the table structure, it should be like this:

    Once you have done that, the code should continue to work as it should even if you update the plugin and loose the changes I have made. Please let me know if it helps to change the table structure, if it does not work then we will mark this as a bug and provide an official fix which should be included in future updates, but for now it seems the issue is only a broken database table which you can fix as outlined above and that should be enough to solve the problem.

    I hope this helps. Please let us know if you have any further questions and feedback.

    Have a nice day.
    Mahlamusa

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.