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

Hacktoberfest 2021 #1457

Closed
SKuipers opened this issue Oct 3, 2021 · 15 comments
Closed

Hacktoberfest 2021 #1457

SKuipers opened this issue Oct 3, 2021 · 15 comments

Comments

@SKuipers
Copy link
Member

SKuipers commented Oct 3, 2021

Screenshot 2021-09-30 at 2 05 35 PM

Hello Gibbon community! A whole crazy, bizarre, incomprehensible year has gone by since last October, and that means it's Hacktoberfest time again 🤯 🎉

Whether you’re an open source veteran or completely new, there are many ways to participate in Hacktoberfest and contribute to Gibbon. Be sure to sign up on the website first so that your first four pull requests count towards a free t-shirt or planting a tree!

Where to start?

If you are new to open source or GitHub, check out the Hacktoberfest Resources page and the tutorials that the DigitalOcean folks have put together: An Introduction to Open Source. We also have some developer docs available at https://docs.gibbonedu.org/developers/ If you have any questions getting your development environment setup, feel free to post in the comments below.

The Gibbon team has been working on refactoring our codebase the past couple versions, and there’s everything from housekeeping items to advanced refactoring items still outstanding. We’ve put together some ideas to get you started, but we also welcome other contributions. When in doubt, please ask us first in the comments below. Thanks!


🚧 Note: Please be sure to reply in the comments before you start working on something, and mention the module(s) it affects. This will help us avoid any overlaps or duplicate effort as we work collaboratively on these changes. I will work to update the items with a mention to who is working on what. Thanks!


Entry-level:

  • Updating Alerts:
    Many areas of the code use raw HTML for alerts. For example:

    echo "<div class='error'>";
    echo __('The highest grouped action cannot be determined.');
    echo '</div>';
    

    These can be replaced with one of two methods: root-level errors, such as access denied, invalid variables, etc. can use the $page->addError(string $message) method. Inline errors, warnings, and messages can use the Format::addAlert(string $message, string $type) method. Be sure to use Gibbon\Services\Format; class if it's not already included.

  • Updating getSettingByScope function calls:
    Completed by @SPie in Use SettingGateway::getSettingByScope #1486

  • Adding null coalesce operators:
    Null coalesce was introduced in PHP7 and we've begun refactoring many areas of the codebase that were using isset() checks on variables, especially $_GET and $_POST variables. Some weren't even using isset checks at all! These variables can be updated with the more succinct format of $variableName = $_GET['variableName'] ?? '';
    🚧 In Progress by @ljfreelancer88

Mid-level:

  • Replacing session variables:
    Completed by @rossdotparker

  • Adding translation to modules:
    Our amazing translators have been asking to translate the additional modules. To do this, we'll first need to add the translation function to any unique strings in these modules. This can be done with the __m() function. For example, 'This is a string' becomes __m('This is a string'). Additional module repos can be found in the GibbonEdu organization page, with details on the Extend page of the Gibbon website.

  • Documentation:
    Our documentation needs some love! Adding or updating the docs is a great way to contribute and create pull requests even if you're not a programmer. Our docs are hosted on GitHub and can be edited through the web UI by creating a pull request (no command line necessary). The best way to find and edit or add pages is through the docs themselves. Look for the "Edit page" and "New page" buttons.

Advanced:

  • Moving SQL into Gateway Classes:
    There are many areas in the codebase that use raw SQL queries for retrieving data from the database. We are working on moving these into gateway classes, which improve maintainability and improve reusability of SQL. This process involves creating a Gateway class for a table if one doesn't exist, then moving the SQL into a method inside the gateway class, and calling that method in the code where the original SQL was.

  • Deprecating Functions:
    There are way too many functions in the functions.php file. These existed before we began to OOify the codebase. Ideally, these should be replaced my methods in either existing classes or new classes. If you pick this task and plan to create classes, be sure to run the names and namespaces by us in the comments below, to ensure they don't clash with core refactoring that is already in the works.

  • Refactoring Tables:
    There are lots of tables left to refactor. Check out the Refactoring Tables issue for a list of the additional modules needing refactored. There are also tonnes of tables left in the core, just search for the HTML <table tag and you'll find 'em. We have a tracking spreadsheet for these, feel free to email [email protected] and we can add you.

Give a shout with any questions.

Happy Hacktoberfest! 👩‍💻 👨‍💻

@Braunson
Copy link

Braunson commented Oct 4, 2021

I can help with a few of these 😊

@SKuipers
Copy link
Member Author

SKuipers commented Oct 5, 2021

Awesome, thanks Braunson! Feel free to give a shout with any questions as you get into the codebase 👍

@ljfreelancer88
Copy link
Contributor

Count me in :)

@SKuipers
Copy link
Member Author

SKuipers commented Oct 6, 2021

Brilliant, thanks @ljfreelancer88!

@JacekAndrzejewski
Copy link

JacekAndrzejewski commented Oct 7, 2021

I'm happy to help, however I don't want to start working on something already being worked on. @Braunson @ljfreelancer88 I would work on Adding translation to modules or Deprecating Functions if those aren't things you started. Based on your forks you didn't, but still it would be cool if you let me know.

@SKuipers
Copy link
Member Author

SKuipers commented Oct 8, 2021

Thanks @JacekAndrzejewski, much appreciated! 😃

@Braunson
Copy link

Braunson commented Oct 8, 2021

Looks like people are picking off items above without making a comment or anything, so after doing a bunch of changes (Session item number) only to see it was already done in the repo, I'll be pulling out, everyone else is welcome to anything here.

@SKuipers
Copy link
Member Author

SKuipers commented Oct 8, 2021

Hi @Braunson, thanks for your message. It is the beginning of Hacktoberfest and I know people are eager to jump into things, so despite people's best intentions, it's possible we may have a bit of overlap as we get up and running with this collaborative effort.

As mentioned, it is certainly more efficient if everyone can please leave a comment in this thread before they start on a set of changes, to prevent any duplicate effort. In that spirit, it sounds like you may have also got started on some changes without leaving a comment first, so these things happen, and as the maintainer I hope they don't dampen anyone's generosity to contribute.

I will reach out to our existing contributors to remind them about this thread, so that people can note what they are working on. I know Ross (our founder) happened to find himself awake early and working on some code, but would have been unaware that someone else had started the same effort.

Thank you everyone for your positive response so-far! Please do be sure to make a note of the changes you're working on, especially noting the module(s) they affect, so we can all aim to collaborate efficiently, and also get our t-shirts 😄

@raynichc
Copy link
Contributor

raynichc commented Oct 8, 2021

This isn't core related, but I'm midway through a massive overhaul of the ATL module backend. Once thats out of the way, I'll probably tackle some core related things. Maybe have a look at the functions.php file.

@rossdotparker
Copy link
Member

I'm working on replacing session variables. Sorry for not mentioning this earlier! My open PR on this is: #1464

@rossdotparker
Copy link
Member

This isn't core related, but I'm midway through a massive overhaul of the ATL module backend. Once thats out of the way, I'll probably tackle some core related things. Maybe have a look at the functions.php file.

I've labelled the ATL module with "hacktoberfest" and "hacktoberfest2021" for you Ray.

@SKuipers
Copy link
Member Author

SKuipers commented Oct 8, 2021

This isn't core related, but I'm midway through a massive overhaul of the ATL module backend. Once thats out of the way, I'll probably tackle some core related things. Maybe have a look at the functions.php file.

Thanks Ray, if you do get into the functions.php, be sure to check here first, and if no one has started, perhaps make a note of which functions you're working on first.

@SPie
Copy link
Contributor

SPie commented Oct 22, 2021

Hi, I'd like to give

Updating getSettingByScope function calls

a try.
Just one question: Is the $container variable accessible in every file and in classes via the global keyword, or are there any part you know of, where I have to include gibbon.php before?

@SKuipers
Copy link
Member Author

Huge thanks @SPie, looking forward to reviewing #1486 👍

@SKuipers
Copy link
Member Author

SKuipers commented Nov 3, 2021

That's a wrap! Thank you everyone for your amazing contributions this Hacktoberfest 😃 we've seen some great refactoring in the core, and appreciate the new contributors who stopped by to lend a hand with our efforts. Much appreciated! Hope you all got your t-shirts or trees for this year's event.

@SKuipers SKuipers closed this as completed Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants