Block Plugin does not appear in the Edit Block/Add List

Block Plugin does not appear in the Edit Block/Add List

by steven bailey -
Number of replies: 7


Average of ratings: -
In reply to steven bailey

Re: Block Plugin does not appear in the Edit Block/Add List

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers

Which block? I can see two that don’t appear to be in the drop down list. Blocks can be set to appear in different contexts - have you tried adding those blocks in a different context, eg. a course page? Have you checked Site Admin > Plugins > Blocks > Manage Blocks? Do they appear in that list?

Did you create these extra blocks from scratch or copy an existing block and change things? Have you got debugging on?

Average of ratings: Useful (1)
In reply to Jon Bolton

Re: Block Plugin does not appear in the Edit Block/Add List

by steven bailey -
Site Admin > Plugins > Blocks > Manage Blocks
Yeah I looked at it before. It only has a very small subset of blocks (not even all those listed when you look at the site admin/plugins/plugin overview)
It does not even list the plugin which I created last year and have successfully deployed on the site.

At present I have only tried adding the blocks to the front page as this is what I had done for my previous block.
In reply to Jon Bolton

Re: Block Plugin does not appear in the Edit Block/Add List

by steven bailey -
As to debugging. as the blocks don't load then they are not executing...

But the point is valid so I have activated: All:Show all reasonable and Display debug messages...
I did notice this.
Notice: Undefined variable: courseId in /home/fhacadem/public_html/blocks/fhacademhtml/block_fhacademhtml.php on line 189

It is a leftover variable from my first plugin which I never cleaned up.... I have seen it before

As to any new messages.
None.
In reply to steven bailey

Re: SEB Block Plugin does not appear in the Edit Block/Add List

by steven bailey -

Looks like the images crushed the text and …. well here it is again....

=============================

Hi everyone.  

I have to say in advance I am a Moodle/PHP novice.  I created 1x Block Plugin last year and I was working on a new one over the last days.  

Both are based from the
https://github.com/danielneis/moodle-block_newblock
https://docs.moodle.org/dev/Blocks
https://docs.moodle.org/dev/Blocks_Advanced
Tutorials as a baseline...……….


But I have encountered a strange behaviour.  With my first foray into Moodle Block development after installing, verifying, and adding to the database.  It would immediately appear in the  Edit Block/Add List (of course once added to the course I could only see the Add Block if I was looking directly at plugins as the course did not allow duplication of blocks).
I have created a new block based upon some functionality of the old.  The install plugin worked and was verified and successfully added to the database.  But it does not appear in the ADD BLOCK interface.


I am attaching 2x screenshots of the blocks in questions and here is the text snippets from the code where I had created the titles.


Can anyone help me discover why it is not on the ADD BLOCK interface?


Many thanks in advance
Steve


============ old block
$string['pluginname'] = 'FHAcademy HTML block';
$string['fhacademhtml'] = 'Forgotten Heralds Academy';
$string['fhacademhtml:addinstance'] = 'Add a new FHAcademy HTML block';
$string['fhacademhtml:myaddinstance'] = 'Add a new FHAcademy HTML block to the My Moodle page';


============ new block
$string['pluginname'] = 'FHAcademy HTML PROMOTION block';
$string['fhacademhtml_promot'] = 'FHAcademy PROMOTION';
$string['fhacademhtml_promot:addinstance'] = 'Add a new FHAcademy HTML PROMOTION block';
$string['fhacademhtml_promot:myaddinstance'] = 'Add a new FHAcademy HTML PROMOTION block to the My Moodle page';
============

In reply to steven bailey

Re: SEB Block Plugin does not appear in the Edit Block/Add List

by steven bailey -
I have performed some additional testing. I am not sure that the issue has to do with my newly created block.
It might have to do something with something that has transpired in between when I created this first block and where we are now.

A few months back we ported the site over to a new hosting provider. We had a couple of small issues with config.php and setting up CRON jobs but that was fairly quickly resolved.

But I decided to refresh my steps and take a step back. I downloaded from github
https://github.com/danielneis/moodle-block_newblock
The baseline where I started my first plugin.
Last year the first test I did back then was to install and add this example block. It worked fine.

I just downloaded it again. I just installed it and tried to add the block. I have the same behavior.
It does not appear in the Add Block / List
It appears in the Site Admin > Plugins > Blocks > Manage Blocks
Just like my plugin from last year and the newly created one

????

Is there soemthing that could have gone wrong in the porting of the site that no longer allows blocks to be added?

or
Average of ratings: Useful (1)
In reply to steven bailey

Re: SEB Block Plugin does not appear in the Edit Block/Add List

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
Could be permissions on the blocks folders/files. Or the “owner” of the files.
In reply to Jon Bolton

Re: SEB Block Plugin does not appear in the Edit Block/Add List

by steven bailey -
How can I check this and what would you suggest should be the proper settings? I read something about this on the forums but could not follow the technical discussions