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

Run updateDataDirectory after Update #14357

Merged
merged 1 commit into from
Mar 11, 2015
Merged

Run updateDataDirectory after Update #14357

merged 1 commit into from
Mar 11, 2015

Conversation

LukasReschke
Copy link
Member

Fixes #13731
fixes #14280

cc @DeepDiver1975

@ghost
Copy link

ghost commented Feb 19, 2015

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/9763/
Test PASSed.

@DeepDiver1975
Copy link
Member

@LukasReschke while at it - can we remove the apache specific check above? In case the upgrade is executed using occ this code block will never be executed - refs #14280

@LukasReschke
Copy link
Member Author

Done. Added as incompatible change in https://github.com/owncloud/core/wiki/ownCloud-8.1-Features as well since this can cause problems if somebody has a custom .htaccess

@ghost
Copy link

ghost commented Feb 19, 2015

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/9771/
Test PASSed.

@DeepDiver1975 DeepDiver1975 added this to the 8.1-next milestone Feb 19, 2015
@DeepDiver1975
Copy link
Member

👍

@DeepDiver1975
Copy link
Member

Please review @th3fallen @bantu @nickvergessen THX

\OC_Setup::updateHtaccess();
\OC_Setup::protectDataDirectory();
} catch (\Exception $e) {
throw new \Exception($e->getMessage());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a rather weird construction. If you know why we're doing this, add a comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blind guess:
To convert the \OC\HintException into a normal Exception with a normal string message

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That assumption is correct. Let me add a comment in regard to this behaviour.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider leaving this exception uncaught. Whoever catches the new exception calls $e->getMessage() anyway? Not sure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that in the update situation we except a regular exception and in the install situation our code expects a HintException and will show it to the user.

If we don't catch it the behaviour is not anymore the one that we wanted.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. But we'll handle that differently later in the code (such as index.php)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ... broken ... but let's move on.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not only this … 🙈

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To reiterate: Code further up in the call stack throws a HintException which can be properly handled by code further down in the stack. However, for some reason, we want the code further down to handle this as a more generic exception of type \Exception. Technical debt ticket?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, the conversion from HintException to \Exception is only necessary because the code further down is capable of handling HintException. If it would not handle HintException, but only the more generic \Exception, everything would be fine.

@LukasReschke LukasReschke mentioned this pull request Feb 23, 2015
@bantu
Copy link

bantu commented Feb 23, 2015

This conflicts now.

@DeepDiver1975
Copy link
Member

@LukasReschke can I ask you for a rebase? THX

@LukasReschke
Copy link
Member Author

Nothing is funnier than a rebase.

@ghost
Copy link

ghost commented Mar 2, 2015

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/10139/
Test FAILed.

@scrutinizer-notifier
Copy link

The inspection completed: 1 updated code elements

@MorrisJobke
Copy link
Contributor

👍

MorrisJobke added a commit that referenced this pull request Mar 11, 2015
Run `updateDataDirectory` after Update
@MorrisJobke MorrisJobke merged commit dbd2bb6 into master Mar 11, 2015
@MorrisJobke MorrisJobke deleted the fix/1373 branch March 11, 2015 17:33
@lock lock bot locked as resolved and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

htaccess not updated if ugrading from occ Run updateDataDirectory after update
6 participants