Eggs module installation/development

Hello,

I’m running a local development instance in docker and I wonder how to enable/install the eggs module.

Is there a direct button/menu from somewhere to the quickforms (I reached it directly on the url /farm/eggs instead). There I can see checkboxes for other modules (milk, planting, move animals etc) but not for eggs.
I also checked the installed modules in the configurations but
How to enable it?

Also I’m thinking about customizing the eggs module, as the european/german regulation needs us to count classes and sizes of eggs, ex:
Class A:
Size S:

Size XL:
Class B:
Class C:

Whats the best way to develop a module locally, and then what entails on making it into a deployment?

1 Like

OK I got one part:

I git cloned git@github.com:farmOS/farm_eggs.git
into www/sites/all/modules/custom
then went into the admin/modules and enabled:

  • Farm Eggs
  • Farm Asset Property

Now I’ll look in ways how to change the module.
Any documentation/tutorials on drupal modules you might recommend?

What is the workflow for updating the module and deployit into the local instance?
drusc cc all and install the module again, for example? or is there a more expedited way?

Thanks!

1 Like

I figured it out.
First draft in GitHub - raleonardo/farm_eggs: Provides a simple UI for creating egg harvest logs. if someone wants to use

2 Likes

You might find the development flow I’ve created for farmOS_wfs interesting. See GitHub - symbioquine/farmOS_wfs at 7.x-1.x

Basically, it’s a docker-compose.yml file which bind mounts and installs the module on startup. This allows for a fully automated and disposable development environment where live editing of the module is mostly possible - though some cases will require a cache clear or disable/enable cycle where DB changes are involved on installation.

1 Like

Thanks @Symbioquine, it looks interesting.

as the whole /var/www/html dir was mapped in my docker-compose.yml, I cloned the farm_eggs module in sites/all/modules/custom subdir and seems to work.

Sometimes takes a while for the changes to take effect, i think regardless of running a “docker run drush cc all” (is this the right way to clear the cache?)

I cloned the farm_eggs module in sites/all/modules/custom subdir and seems to work.

That’s a good place for it. :+1:

Sometimes takes a while for the changes to take effect, i think regardless of running a “docker run drush cc all” (is this the right way to clear the cache?)

Yep! That will clear the cache!

There are some other considerations you may be running into though…

drush cc menu will rebuild the {menu_router} database table - which does not happen on drush cc itself. This is only necessary if changes are being made to hook_menu() implementations, though, so that’s probably not what you’re running into.

The other “gotcha” is that PHP’s opcode cache is enabled by default in the Docker image, which means changes to files might not get picked up immediately (I think it defaults to watching for changes every 60 seconds). We fixed this in the 2.x branch but haven’t backported it to 1.x.

The workaround (as well as some other helpful hints) are available here: Bump engine.io from 4.1.1 to 4.1.2 by dependabot[bot] · Pull Request #36 · farmOS/farmOS.org · GitHub

Oh wait… that’s not right actually.

It should be either:

docker exec -it [container-name] drush cc all

or:

docker-compose exec www drush cc all

(docker run will start a new container, whereas docker exec is for executing a command inside a running container. Maybe that’s what you meant… but figured I’d clarify.) :slight_smile:

Hi Y’all

I’m trying to figure out how to relate each egg collection to an area where currently the asset (bird group) is, or manually selecting it. Is it somehow possible to implement this with the eggs quickform?

As I see in the code, farm_quantity_log_create and farm_quick_entity_link don’t implement any area reference.

Ahhh that’s right!.. Thanks!

This might be what’s getting me the random times for the new code to be picked up…

1 Like

I’m trying to figure out how to relate each egg collection to an area where currently the asset (bird group) is

In the submit function (farm_eggs_form_submit()), right after the log is created (via farm_quantity_log_create()) you could add some additional code that adds more info to the $log object, and then call log_save($log) to save those changes.

So, you could look up the location of the referenced animal assets (with farm_movement_asset_location(): https://github.com/farmOS/farmOS/blob/1d687d8ae0234af1ed00c0d7be35a79fef4ebb17/modules/farm/farm_movement/farm_movement.location.inc#L204), and then use that to fill in the log’s field_farm_area reference field.

Cool idea!

This might be what’s getting me the random times for the new code to be picked up…

FYI Here is the fix we did in 1.x for this: https://github.com/farmOS/farmOS/blob/f3dd0d5a6153bab07c3782286e12cc55e6d77dd2/docker/dev/Dockerfile#L22

1 Like

Hello raleonardo and others who posted here,
I am into poultry farm business, looking to utilise a software to manage the farm. I am researching to know if farmOS is a good fit for the farm. The thread attracted me as Ricardo seems to do something like a im looking for. Will this farrmOs fit for poultry farm business? Ricardo can i contact you? this is my email: basstone40@gmail.com

Thank you all, and i am sorry for the noise i may have made!

1 Like