Both. I have thoroughly tested this, and generating a new world in 1.8, putting a farmer villager in a pen with carrots or potatoes growing, regardless of whether or not the farm area is within a village, causes the villager to stop harvesting once it has more than around 60 carrots or potatoes in its inventory (tested with /entitydata @e[type=Villager,c=1] {}), also regardless of whether it has harvested those carrots or potatoes or was given them by the player.
If this works as intended, we need something to replace the old method where the command fails if the selector is not found.
You can't specify NBT Data for entity selectors or player selectors. The only exception is /testfor [entity] {dataTag}. You'll have to find an alternate way to accomplish your goal.
There needs to also be a way to retain the random flight of fireworks when shot from dispensers. Because they shoot straight now, 1.15 ruined the ability to have good automated firework shows.