cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with backups

SOLVED

Problems with backups

Hi everyone,

 

this is the first time I am using the forum, so forgive me if I am not following any proper code of conduct that I should. Anyway, going straight to my problem, I am trying to do a system backup (System/Tools/Backups) and when I enter the link, I already have a number of errors shown on the console of firebug. Here:

 

TypeError: ({initialize:(function (a, b){
        this.reset();
        this.rollbackUrl = this.backupUrl = '';
        this.rollbackValidator = new Validation($('rollback-form'));
        this.backupValidator = new Validation($('backup-form'));
    }), reset:(function () {
        this.time = 0;
        this.type = '';
        $('use-ftp-checkbox-row').hide();
        $('use_ftp').checked = false;
        $('ftp-credentials-container').hide();
        $$('#ftp-credentials-container input').each(function(item) {
            item.removeClassName('required-entry');
        });
        $('backup_maintenance_mode').checked = false;
        $('rollback_maintenance_mode').checked = false;
        $('exclude_media').checked = false;
        $('password').value = '';
        $('backup_name').value = '';
        $$('.validation-advice').invoke('remove');
        $$('input').invoke('removeClassName', 'validation-failed');
        $$('input').invoke('removeClassName', 'validation-passed');
        $$('.backup-messages').invoke('hide');
        $$('#ftp-credentials-container input').each(function(item) {
            item.value = '';
        });
    }), backup:(function (type) {
        this.reset();
        this.type = type;
        this.showBackupWarning();
        return false;
    }), rollback:(function (type, time) {
        this.reset();
        this.time = time;
        this.type = type;
        this.showRollbackWarning();
        return false;
    }), showBackupWarning:(function () {
        this.showPopup('backup-warning');
    }), showRollbackWarning:(function () {
        this.showPopup('rollback-warning');
    }), requestBackupOptions:(function () {
        this.hidePopups();
        var action = this.type != 'snapshot' ? 'hide' : 'show';
        $$('#exclude-media-checkbox-container').invoke(action);
        this.showPopup('backup-options');
    }), requestPassword:(function () {
        this.hidePopups();
        this.type != 'db' ? $('use-ftp-checkbox-row').show() : $('use-ftp-checkbox-row').hide();
        this.showPopup('rollback-request-password');
    }), toggleFtpCredentialsForm:(function () {
        $('use_ftp').checked ? $('ftp-credentials-container').show()
            : $('ftp-credentials-container').hide();
        var divId = 'rollback-request-password';

        $$('#ftp-credentials-container input').each(function(item) {
            if (item.name == 'ftp_path') return;
            $('use_ftp').checked ? item.addClassName('required-entry') : item.removeClassName('required-entry');
        });

        $(divId).show().setStyle({
            'marginTop': -$(divId).getDimensions().height / 2 + 'px'
        });
    }), submitBackup:(function () {
        if (!!this.backupValidator && this.backupValidator.validate()) {
            this.hidePopups();
            var data = {
                'type': this.type,
                'maintenance_mode': $('backup_maintenance_mode').checked ? 1 : 0,
                'backup_name': $('backup_name').value,
                'exclude_media': $('exclude_media').checked ? 1 : 0
            };

            new Ajax.Request(this.backupUrl, {
                onSuccess: function(transport) {
                    this.processResponse(transport, 'backup-options');
                }.bind(this),
                method: 'post',
                parameters: data
            });
        }
        return false;
    }), submitRollback:(function () {
        if (!!this.rollbackValidator && this.rollbackValidator.validate()) {
            var data = this.getPostData();
            this.hidePopups();
            new Ajax.Request(this.rollbackUrl, {
                onSuccess: function(transport) {
                    this.processResponse(transport, 'rollback-request-password');
                }.bind(this),
                method: 'post',
                parameters: data
            });
        }
        return false;
    }), processResponse:(function (transport, popupId) {
        if (!transport.responseText.isJSON()) {
            return;
        }

        var json = transport.responseText.evalJSON();

        if (!!json.error) {
            this.displayError(popupId, json.error);
            this.showPopup(popupId);
            return;
        }

        if (!!json.redirect_url) {
            setLocation(json.redirect_url);
        }
    }), displayError:(function (parentContainer, message) {
        var messageHtml = this.getErrorMessageHtml(message);
        $$('#' + parentContainer + ' .backup-messages .messages').invoke('update', messageHtml);
        $$('#' + parentContainer + ' .backup-messages').invoke('show');
    }), getErrorMessageHtml:(function (message) {
        return '<li class="error-msg"><ul><li><span>' + message + '</span></li></ul></li>';
    }), getPostData&colon;(function () {
        var data = $('rollback-form').serialize(true);
        data['time'] = this.time;
        data['type'] = this.type;
        return data;
    }), showPopup:(function (divId) {
        $(divId).show().setStyle({
            'marginTop': -$(divId).getDimensions().height / 2 + 'px'
        });
        $('popup-window-mask').setStyle({
            height: $('html-body').getHeight() + 'px'
        }).show();
    }), hidePopups:(function () {
        $$('.backup-dialog').each(Element.hide);
        $('popup-window-mask').hide();
    })}) is not a function
	

AdminBackup.prototype = {

And then, no buttons work. I am circumventing the problem by simply doing a tar of my magento directory and mysqldump, but I am very worried about why this is happening. Can someone help?

 

Thanks

Fred

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Problems with backups

So! Mistery discovered! I had under System/Advanced/Developer/Javascript Settings

 

Merge Javascript file = YES

 

I thought it would improve site performance with that. IT DOESN'T and it creates a bad and big javascript that doesn't work. I will open a ticket for the developers, but for me this issue is closed. 

 

Sorry for bothering everyone and I hope it helps others.

 

Thanks

Fred

View solution in original post

4 REPLIES 4

Re: Problems with backups

Hi everyone,

 

I am still having problems and now I see that the problem maybe related to a prototype.js. See here:

 

http://magento.stackexchange.com/questions/33348/uncaught-typeerror-undefined-is-not-a-function-when...

 

I don´t want to go around changing code from magento. Is this the only solution? What is going on? Thanks for any help.

Re: Problems with backups

Hi,

 

my problem is not going away, quite the opposite. Now I am finding more and more admin functions that are not working. Examples:

1. backups - this was the first one.

2. CMS;editing static blocks

3. Promotions/Rules for the shopping cart -adding or editing any rule

the list goes on, but important is that it is always @ prototype.js

 

It fails always on the call to a <function>.prototype, saying it is not a function. This one here was AdminBackup but there are others.

 

I now updated my version of prototype.js on ./js/prototype/ to the latest 1.7.3 with no luck. It seems it fails on.

 

var $continue = new Error('"throw $continue" is deprecated, use "return" instead');

 

I am not very good on Javascript and I am trying with firebug to identify what the problem could be but if anyone can give me help I would appreciate. If someone could at least point me to where or what to look at.

 

Many thanks

Re: Problems with backups

HI... I really need help on this. I am testing another instance of magento where I don't have the problem, and there, the javascript is not combined into one big file. Could this be the problem? And how can I stop magento from combining? thanks

Re: Problems with backups

So! Mistery discovered! I had under System/Advanced/Developer/Javascript Settings

 

Merge Javascript file = YES

 

I thought it would improve site performance with that. IT DOESN'T and it creates a bad and big javascript that doesn't work. I will open a ticket for the developers, but for me this issue is closed. 

 

Sorry for bothering everyone and I hope it helps others.

 

Thanks

Fred