Skip to content

Conversation

martin-call-learning
Copy link
Contributor

Still some issues to fix.
This pull request if you have some time so you can see what i've done and so our meeting tomorrow would be even more interesting. ;)
As I told you in Matrix there is this issue remaining :

Potentially polymorphic call. renderer_base does not have members in its hierarchy

And another wich comes from an higher class

Expected parameter of type 'context', 'null|stdClass' provided

And some imports that are unknown but I think I have to lay it as it was

Copy link
Contributor

@laurentdavid laurentdavid left a comment

Choose a reason for hiding this comment

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

Salut Martin,

De très bon changements et optimisations en général. Le seul bémol: il faudrait tester cela avec le feed ici https://www.imt.fr/feed/ car il y a quelques erreurs fatales dues à des changements de types.


/** @var bool track whether any of the output feeds have recorded failures */
private $hasfailedfeeds = false;
private bool $hasfailedfeeds = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Attention ici on contraint les utilisateurs à utiliser PHP 7.4. C'est désiré mais pas forcément le cas pour tout le monde et jusqu'à Moodle 3.11, on ne requiers que du 7.3. Sachant qu'en PHP 7.3 la déclaration ici va empêcher le bloc de fonctionner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oui, je me souviens que j'avais commencé à enlever les types, mais j'ai dû en oublier, je me mets dessus

}

// initalise block content object
// Initialise block content object.
Copy link
Contributor

Choose a reason for hiding this comment

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

Bien vu !

* @return block_rss_client\output\footer|null The renderable footer or null if none should be displayed.
*/
protected function get_footer($feedrecords) {
protected function get_footer($feedrecords) : block_rss_client\output\footer {
Copy link
Contributor

Choose a reason for hiding this comment

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

Là aussi voir la compatibilité PHP. A mon avis c'est bon car c'est du PHP 7.3+.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Je vais me renseigner

* @return block_rss_client\output\feed|null The renderable feed or null of there is an error
*/
public function get_feed($feedrecord, $maxentries, $showtitle) {
public function get_feed($feedrecord, $maxentries, $showtitle) : ?block_rss_client\output\feed {
Copy link
Contributor

Choose a reason for hiding this comment

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

La et au dessus: tu as importé le namespace pour avoir la classe feed, donc le mieux c'est d'utiliser "feed" aussi ici.

*/
public function __construct($carousselspeed, array $feeds = array()) {
$this->feeds = $feeds;
parent::__construct($feeds);
Copy link
Contributor

Choose a reason for hiding this comment

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

Bien vu!

protected $imageurl = null;
protected $categories = null;
protected ?string $imageurl = null;
protected ?string $categories = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ici c'est un tableau ! Tu verras, une erreur fatale se produit ici.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bizarre que j'aie mis ça haha, surtout que je savais que c'est un tableau

* @return block_rss_client\output\footer|null The renderable footer or null if none should be displayed.
*/
protected function get_footer($feedrecords) {
protected function get_footer($feedrecords) : block_rss_client\output\footer {
Copy link
Contributor

Choose a reason for hiding this comment

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

Attention: c'est ?block_rss_client\output\footer (sinon une erreur fatale se produit)


defined('MOODLE_INTERNAL') || die();

$plugin->version = 2021012200; // The current plugin version (Date: YYYYMMDDXX).
Copy link
Contributor

Choose a reason for hiding this comment

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

Tu peux incrémenter la version ici, surtout si tu as changé un language string (ça rafraîchira le cache).

Copy link
Contributor

@laurentdavid laurentdavid left a comment

Choose a reason for hiding this comment

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

Je mettrai ici 7.3, 7.4 et 8.0. Comme ça on couvre du 3.9 à 4.x
Il faudra rebase le commit et le squasher avec le précédent.


// Insert a new RSS Feed.
require_once("{$CFG->libdir}/simplepie/moodle_simplepie.php");
require_once("$CFG->libdir/simplepie/moodle_simplepie.php");
Copy link
Contributor

Choose a reason for hiding this comment

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

Là il y a un soucis dû à autre chose que ton changement. Il faudrait déclarer la variable $CFG.

* Test get feed method
* Refactor plugin and documentation
@laurentdavid laurentdavid merged commit 49ca854 into call-learning:master Oct 20, 2022
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

Successfully merging this pull request may close these issues.

2 participants