The ruling does not apply to the UK or Ireland, which are not within the Schengen zone. It also does not apply to Denmark, which although a member of the Schengen zone holds an opt out from European Union justice policies.
The ruling also contains some important conditions.
It says migrants may be detained - for up to 18 months - if there is "a risk of the removal being compromised", which may be interpreted to mean that they are a flight risk.
Detention is also permitted if a person is subject to a deportation order and has refused to go, or if they have already been deported, and have attempted to re-enter the country illegally, in breach of an entry ban.
So if our borders are strong enough anyone entering illegally can be detained and deported. Also, if the illegals are breaking the law in France but attempting to hide themselves in vehicles/ walk through the tunnel etc they can be detained as possible criminals. The 'problem' is one of implementation by the French, though why they should police our borders for us is a mystery to me.