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

fix break that should have been converted to a return #63

Conversation

tuxayo
Copy link
Contributor

@tuxayo tuxayo commented Jul 1, 2016

It's a syntax error for the PHP 7 parser (but not for the 5.6 one...)
It came from there:
137c9fd#diff-72bd8d1f368642e7efcbee7099f52c26L671
But when it was extracted to the current file it should have been
replaced by a return to prevent the rest from executing.

It's a syntax error for the PHP 7 parser (but not for the 5.6 one...)
It came from there:
coral-erm@137c9fd#diff-72bd8d1f368642e7efcbee7099f52c26L671
But when it was extracted to the current file it should have been
replaced by a return to prevent the rest from executing.
@jeffnm jeffnm added the bug This is a bug (not an enhancement) label Jul 1, 2016
@remocrevo remocrevo added bug This is a bug (not an enhancement) and removed bug This is a bug (not an enhancement) labels Jul 11, 2016
@tuxayo
Copy link
Contributor Author

tuxayo commented Jul 13, 2016

Note that this error was found by checking all the php files with
find . -name *.php -print0 | xargs -0 -I file sh -c "php -l 'file' || true" | grep -v "No syntax errors"

with PHP 7 and PHP 5.6. And there are no other errors. (except one in /usage/old/)

@veggiematts veggiematts merged commit 8c329ec into coral-erm:master Jul 13, 2016
@tuxayo tuxayo deleted the fix_break_that_should_have_been_converted_to_return branch July 13, 2016 07:56
fondrenlibrary added a commit that referenced this pull request Aug 26, 2016
…ues can be correctly captured and saved after costForm.js is modified to only allow selecting tax fields in .paymentTable TR (table row)
jeffnm pushed a commit to wc-library/Coral that referenced this pull request Oct 19, 2016
* modules_to_use needs meets_system_requirements

* Added note to self on how to get number of tables in db

* Fixed typo in condition

* Working on default_db_user postInstallationTest

* Something's dodgy with our ini exporter

* Building post-installation test for config file access

* Add \r to ini files

* Runs post-installation tests

* Registers post-installation test
Ensures config files are not writable

* Changed spacing

* Additional spacing change (for consistency)

* Sanitise varialbes for html
(specifically the default_value)

* Trying with simple addslashes for ini file

* Post installation test ensuring default user has limited access
Rather sophisticated if I do say so myself

* Better file permissions to have committed

* Reenable redirection

* Re-enable attempt to correctly privilege default user

* Fixed default username (to "coral", was "admin")

* Fixed disallowed characters and password generation.

* Better handling of pre-existing db.

* Serialize type=hidden elements

* Prevent changes in master from slipping through because we aren't using (modifying) these files.

* Considers an empty db to DB_CREATED
so DB_ALREADY_EXISTED implies it contains data

* If messages should be set early so we can assume its set

* Handles DB already existing (and not being empty)
Gives options:
 - redirect to upgrade
 - use tables
 - delete tables
 - just check again (user can do something manually)

* Doesn't handle empty dbs properly - still throwing errors

* Fixed handling of empty dbs.
It's not good at handling the case where stuff it's checked is changed midinstallation (because it needs to keep track of whether it created the db and then proceed accordingly and if that is changed it's difficult to recover).
I think as it stands this works though - it is a real edge case to have the dbs externally modified (involving dropping tables or dbs) mid-install.

* Cleaning up some todos

* Cleaning more unnecessary comments

* Moved css out of install_page

* Added todo for idea that needs to be considered

* Checking whether CORAL is already installed.

* Added some spacing between option buttons and instruction

* Moving session_start

* Does usage need resources?

* Asks for user interaction if it can't figure out previous installation status

* Added a thoroughly commented example installer.
(for documentation)

* Noticed a problem line. Added todo to fix it.

* Writes common/conf file with CORAL Installer version.
Indicates that unified installer can be used.

* Ignoring common conf file

* Some work towards declareInstallationComplete
(not functional, commented out next to TODO)

* Modified useModele variable for easier reading

* Changed version: 2.0.0

* Testing set_installed_var but not working

* Writes config file with installed and enabled var for each module
 - Changes for upgrade scripts
   - Installed means that at some point the installer func was run
   - Enabled means it's in use and it should appear on menus etc.
   - Uninstall will just disable
   - Upgrades will happen to all installed modules (whether or not they are enabled)
   - This will preserve data at the latest CORAL version
 - Change to the way modules are registered with modules_to_use
 - Looping through modules takes into account whether they are to be used or not
   - Important for creating dbs
   - Important for creating conf files
   - Important for testing default db username & password

* Builds index menu using common config

* DBService modified for previous changes to Config.php

* Fix to loadTemporaryDBSettings for changes to Config.php

* Refactor to remove ARRAY_FILTER_USE_BOTH
 - For backwards compatibility
 - Less "functional" approach

* Try to parse file only if it exists

* Improved checks for password and username limitations

* Changed (reduced) titles

* Moved variable so it's not generally accessible

* Added initial upgrade script outline

* Outlining code for upgrader

* Revoke doesn't cause grant to fail if user doesn't exist

* Fixed typo

* Handles permissions better when php user owns files

* Tries to fix file permissions on its own.

* Tries to fix file permissions on its own.

* Config function to return current version

* Added simple is_installed function to check Config for version

* Coral root controls installation

* Remove old install.php

* Reloads page once installation is complete

* Remove unnecessary variable

* If Coral is installed, user is prompted to choose modules

* Calculate root dir for redirection (for root dir other than /)

* Changed style of hovered icon (text goes lighter)

* Redirect at the end of registering an installed instance of Coral

* Removed unnecessary variable
(install/index.php has a better way of testing what is calling it)

* Use Y/N in conf file

* Lost line from 342012d@jcuenod when file moved in merge

* install/index.php will handle upgrades
 - root index.php simply includes it and it will check what is needed
 - test_if_installed no longer holds is_installed function
 - test_if_installed now functions more to figure out whether to install
 - building towards a do_upgrade function but need to do work on versions

* Better test for possible existing install.
Removed commented code (needs to be replaced still in install/index.php) but doesn't belong here
Will need to rethink user interaction here

* Ensure that the installer has been well set up.

* Added some helper getters (get installed/enabled modules)

* Building up the upgrade loop

* Thinking about the upgrade process and losing

* Further planning for upgrade and modification

* Changed required value for planning in upgrades branch

* Moving towards master installers for different purposes (install/upgrade/modify)

* Refactored nomenaclature to install_provider
 - not module_installer any more
 - building up upgrade_to_version with checks

* Implementing some_kind_of_auth
 - Handles dep for auth if it is chosen
 - Otherwise requires remote_auth (which gets a var)
 - Abrogates need for "wants"

* Purge remaining wants code from installer and readme

* remote_auth provider should be done (but untested)

* Use REQUIRED_FOR_INSTALL from Installer class
 - Changed `FOR_INSTALL` to `REQUIRED_FOR_INSTALL`
 - Also `getCheckListUids` to `getRequiredProviders`
 - alternative code is commented out (one logical reshuffle ln95-98)

* Improved message when register_..._provider functinon missing

* Fixed getRequiredProviders (return uids only) and removed isRequired (unused)

* Fixed name of remote_auth provider file

* Fix the way remote_auth_variable is set and remove `alternative` code

* Auth module doesn't need to force us to handle remote_auth_variable now

* Remove the remnants of `alternative`

* Fix silly typo (wrong variable name used)

* Set default value if previous value was invalid but somethin in session

* Implement draw_page_template_if_necessary (root/index.php always goes here)

* Checks that remote_auth_variable is set before putting it into conf var

* Get conf modules to use from `modules_to_use` and require `some_kind_of_auth`

* Fixed use of data var when ajax call fails

* Shuffling (improving?) install logic for upgrade and for root/index.php

* Fix post-installation mode

By post-installation mode the conf file is set making it look as though CORAL is installed.

* Improvements to remote_auth

- Added translation to invalid remote auth var
- Changed title to be imperative not indicative
- Changed where remote_auth_var is stored in session

* Remove `required` (which is no longer used)

* Added useful error for missing upgrader

* Forgot to add const to previous commit

* The future of upgrading in a beautiful comment never to be forgotten

* Upgrader promoted to installer with own deps and sharedInfo

* Introducing get_db_connection to abstract creating a connection

Optionally takes username and password details allowing the updaters to use data from their conf files (if necessary)

* Use bundle to gather dependency_array, sharedInfo and function together

Note: Does not work with current Installer

* Remove a terrible bit of hacky code (didn't do anything yet)

* Clearing out old dependency gathering code

* Fixed up some merging issues and corrected a bug (see success = false)

* have_db_access and get_db_conn use bundle

* Added fairly important todo

* Adding some overlooked parameters (with use)

* Remove array_merge and return simple variable

* Stop bundles from using required var (removed)

* Fixed typo concerning dynamically registered tests

They used to be post-installation only but now they could be anything.

* When tests are malformed debug_print_backtrace may come in handy

This is just a comment to help you on your way future developer...

* Convert post-installation installers to bundles

* Use bundles rather than installers

* Changed function name for consistency (upgradeToVersion)

* Fresh install with version=0 works!

* Remove unused legacy options from code

* Changing not to use $MODULE_VARS where possible

* Not Working: Building the actual upgrade process to match the install

Upgrade_helper is going to form the backbone by providing us with necessary dependencies

* Added instruction on modules_to_use.
Fixes issue jeffnm#1 (email)

* End of the day commit. Busy with jeffnm#2 & jeffnm#5 (email)

* Rename "requirements" to "providers" for core installers

Because they aren't required, they're just there to help out.

* Remove upgrade option

Coral should know when an upgrade is required and automagically get it going.

* Moved if clause fixing logical error (fixes jeffnm#2)

* Added instruction regarding table names (fixes jeffnm#2)

* Changed title when db already exists and changed some whitespace

* I'm pretty sure this needs to be returned - not certain though... lol

* Fix logical error with auth offering to use ldap (should fix jeffnm#3)

* Further logical error correction for options when db already existed

* Insert the admin user to auth table using provided username

* Changes from upstream merged into backup files

auth adds a password for the default admin user
management & reports are simple switches to mysqli and some whitespace changes.

* Changed directory of install providers for merge with unified_installer

* Temporary fix for missing config file (i.e. not installed) - needs permanent fix!

* Fix variable name that somehow got missed in the merge

* run_loop no longer takes the requirements var

* Added have_default_coral_admin_user dependency to auth installer

* Installer now has an install version string constant that modules use

Version strings need to be *strings* consistently.
Switch cannot handle mixed types - beware!

* Provide dependencies on shared_module_information

This is basically so that modules_to_use is going to be able to force the user to enable modules that are dependent on one another.

* text_field_template now escapes html special characters in default value

* Change have_default_coral_admin to use text_field_template (not its own fork)

* Only sanitize default_values

* Get default admin password from user

Requires 8 character password
Small changes to ldap stuff as well

* re-add fund name back to summary page after a recent pull

* fixed an issue with submission of cost form (costForm.js)

* Removed (seemingly) unused code and fixed indentation

* Fixed logical error in checking dependencies with module selection

Also now tells the user which module has the unmet dependency.

* Removed redundant code and rearranged to make easier to read

* Improvements to random string generator code

Probably needs to be abstraced

* Require at least php 5.5.35

Which means we have no more use for array_column shim (removed)

* Preparing for merge back into unified_installer

Some loss of code that will need to be reimplemented (non-functional code though)

* Fixing regression from ed5072e that stops suppressing mysqli vomit

* Declare messages array (don't know how this survived so long)

* Moved indexstyles.css to css folder and fixed paths

Found lots of unused css

* Cleaned up index.php and (esp.) indexstyles.css

Translation doesn't seem to be working
Removed common.js (unused)
Changed lots of tags to html5 standards
Fixed indentation

* Modules_to_use supports different installation modes (upgrade & install)

* Fixed width bug when there are fewer than three cards

* Added modify const and used uppercase

* Store db details in common config file (for upgrades and modifications)

* Allows empty list of database names (for upgrading)

* Installers are instantiated with a version string

So we don't have to pass it around all the time

* "The future" (initial, minimal upgrade design)

* Re-add HTML5 Placeholder to prompt suggested/required date format for text fields used to accept dates about Resource

* add tax fields into the summary page

* fixed an issue not detected in its original PR coral-erm#63.Now tax fields values can be correctly captured and saved after costForm.js is modified to only allow selecting tax fields in .paymentTable TR (table row)

* Changed variable name for readability

* Updating have_database_access to handle different installation modes (upgrade)

* Fixed logical error when not maybe_installed

* Reduced php version requirements to php 5.5.0

* Fixed typo (resulting from too much copy pasting)

* Improved title descriptor

* Converted const to normal variable because old versions of PHP suck

* Uses global variable (not const any more)

* Make database_details_template able to not-ask for the host field

* remove a line for debug in costForm.js

* Answered my todo, should fix outstanding ldap user issue

* Add comment explaining previous commit

* loadTempSettings array_merges temp settings

* Support for default values in db connection settings

* Make db access vars required

* Fixed #5 - was redirecting indefinitely on Windows system because SCRI[T_FILENAME used forward slashes and __DIR__ used backslashes, so the if statement on install/index.php always ran

* removed test code, modified if statement at top of install/index.php so it wouldn't encounter issues with backslashes and forward slashes in Windows

* Fixed host field after merge conflict

* WIP (fixed in next commit)

* Prioritise session over config file for db settings

Rearrange some logic to prioritise
Added some comments to make this file more readable

* Improved readability (slightly) with namespace variables

* Renamed getPostInstallationMode to isInPostInstallationMode (so that bool is expected)

* Fix for lack of const arrays

* We need VERSION_STRING_INSTALL here

so require_once will have to do - I can't think of a better solution (it's required in run_loop)

* Added another comment to help with readability

* Support for giving db access when modules are being upgraded

(so db name is fixed and just needs to be passed in and tested with super user)

* Bizarre dependency fixed to the actual dependency

* Can run a full upgrade (assumes installed version 2.0.0)

* Added comment to remind me where I'm leaving off and fixed spaces->tabs

* Upgrade can process sql files and update config files

* Reintegrated array_column shim

* Fix for lack of global consts

* Fix for modified modules_to_use that requires second parameter

* Changed namespace variable to pass into upgradeToUnifiedInstaller function

* "namespace" is just too verbose, use "ns"

* Store variables in session (in case the config file is not writable)

Before, the user would be asked twice because when we try to write the config file, we fail and have to wait for the user to give us permissions but then the _POST vars are lost.

* Populate common conf with db details

* Config throws more errors if variables requested are unavailable

* Generalised way of upgrading

Just another case statement and a sql file with the right version number in its name.

* Remove hypothetical test sql file & auth just returns true

* Upgrade helper returns true and has two important Todos

* Installer expects either version "2.0.0" or "1.9.0"

Version "1.9.0" is populated into the conf file if the installer is run on a previously installed version of Coral.

* Removed INSTALLATION_IN_PROGRESS const (was always true and used badly)

* Updates run for 2.0.0 (from 1.9.0). Only affects licensing and resources

* Make updating user initiated

* Clean up comments abstract drawing of template

* Much better way of handling the loop

* Improved completion messages after install/upgrade
@PaulPoulain PaulPoulain added this to the Version 2.0.0 milestone Mar 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a bug (not an enhancement)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants