Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

afterAllStepsHook() never runs in plugins #21

Open
klas opened this issue Nov 11, 2015 · 1 comment
Open

afterAllStepsHook() never runs in plugins #21

klas opened this issue Nov 11, 2015 · 1 comment

Comments

@klas
Copy link
Contributor

klas commented Nov 11, 2015

        // Select last step
    $query->select('name');
    $query->from($this->_table);
    //$query->where("(status = 0 OR status = 1)");
    $query->where("(status = 0)");
    if ($this->_table == '#__jupgradepro_extensions_tables') {
        $query->where("element = '{$step['element']}'");
    }
    $query->where("version = {$this->_db->quote($this->old_ver)}");
    $query->order('id DESC');
    $query->limit(1);
    $testquery = (string)$query;
    $this->_db->setQuery($query);
    $step['laststep'] = $this->_db->loadResult();

Will not return any result when we are in the actual last step, last steps $step['laststep'] is empty as tables status in jupgradepro_extensions_tables is changed to 1 before this point.

This causes the bellow code from JUpgradepro::setDestinationData to never evaluate to true

// Call after all steps hook
if ($this->_step->name == $this->_step->laststep && $this->_step->cache == 0 && $this->getTotal() == $this->_step->cid) {
    $this->ready = $this->afterAllStepsHook();
}

If a change query where above to get true laststep to $query->where("(status = 0 OR status = 1)"); this breaks plugins execution - only first plugin is executed as code somewhere thinks this is the last of all plugin steps...

Needs to be fixed by you, I was going in circles here... perhaps just $this->_step->name == $this->_step->laststep should be changed to $this->_step->laststep == '' in if clause - or query should be changed as sugegsted and mutiple plugins executin resolved in some other way e.g. by javascript changes.

@fastslack
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants